Trouble in Internationalisation, iOS - ios

I need to internationalize some of the labels in a screen; do I need to localize the whole screen?
One more doubt, I have taken a string file and pulling the value of the keys from that file directly from that file using NSLocalizedString, then also do I need to localize the screen or it will by default get localized?
Thanks in advance.

you need not to localize the whole screen.
for two label only, on viewdidLoad
self.lbe1.text = NSLocalizedString(#"Label1", nil)
self.lbe2.text = NSLocalizedString(#"Label2", nil)
your second doubt is not clear to me.

You have to create the localize file. Then label you can use the localized id. Then you don't need to worry the whole screen or particular screen or particular text. Because whatever you can change. If you want more info refer this link
http://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014

Related

Is it possible to remove a UILabel from localization?

Hello localisation pros,
after searching the various tutorials, tipps and tricks around "Localization" and of course this stackoverflow forum, I have to commit, that I did not find a good answer. Thats why I post my problem here and hope for an answer.
I have two types of UILabel in my Storyboard. And I have plenty of each type in the app.
One type contains text, that is not necessary to localize, because it is just an integer (e.g. "5"), or an emoji or it is just an international word (e.g. "Computer").
And of course I have the other type of UILabel in my app, that contain text, that must be localized.
When exporting for localization, ALL UILabel in the Storyboard will be put in the localization files by xCode and makes the file bigger than necessary, since plenty of the UILabels belong to type 1.
Is there any way, to take out these UILabels from the localization process and to mark them as "not necessary to localize" ??
Thanks for helping.
You need to manually remove the each label entry from localize file as Xcode localize whole storyboard not single one or you can create xib of each viewController the you can localize each viewController .
Thanks
Change them to attributed and they won't get exported.

TextView's font i not changing in storyboard

as you can see in the above i'm trying to change my textView's font , but it didn't changing i searched some related terms on changing for like this one
and this , but nothing worked for me
i'm also not sure if this is the correct name of my desired font or not
titleTextView.font = UIFont(name: "Myriad-Condensed", size: 25)
even in this site they dont have anything related to my desired font which is Myriad pro Condensed according to storyboard's attribute inspector
anyone faced anything similar to this before ?? or any clue what i should do ? then please let me know
First you need a font to use. Download any of them in you cass its right here : http://ufonts.com/fonts/myriadpro-cond.html
After downloading drag & drop the font file (otf or ttf) into your project
Make sure you check the box next to your target or the font won’t actually get included in your app (even though it’ll probably show in Interface Builder).
Open up the Info.plist . Add a new array of strings to it: “Fonts provided by application”. Add the filenames for each font you want to use as String entries in the array. (That one ttf file you just added to your project )
Now you're good to go , select that font once again like you did in the attached image.
For more detail see this article https://grokswift.com/custom-fonts/

iOS is there a way to assign Localized String to a UILable from IB/storyboard

I want to assign NSLocalizedString(key, comment) to a UILabel from storyboard without creating an outlet for it.
Just select your storyboard/xib, go to File Inspector. In the Localization part, you can tick the language you want. Then, it will create a .string file with all text used in storyboard. You'll just have to provide a translation for each text used in storyboard.
If no language appear in this part, you have to change values of Localization native development region in Info of your project.
This might help, the official Apple guide to translating storyboard texts. I found it pretty straightforward. I am currently translating texts in-code, in the storyboard and in my info.plist files without issue. Hope it helps!

How can i right align a Text Field in the settings bundle of an app , iOS?

I have in my settings bundle of my application two text fields , where the user can give latitude and longitude values.
The bundle settings look like this :
As you see the values (43.46 and -3.81) are left aligned.
Is there a way to right align them so it looks better?
It seems the only answer to this question is to add spaces on the title of the text field , till your values move to the left side.
Is not very delicate , but looks better than this.
This worked for me in in-app settings view. I have not tried it with settings.
Open property list file as a source and paste the following to the for each entry you want right-aligned:
<key>IASKTextAlignment</key>
<string>IASKUITextAlignmentCenter</string>
Or do the same through the plist editor.
You can do that in different way. You have to add a Title preference item. and add titles and values inside that.
I have a screenshot here,
And the resulting settings screen will look like this,

How does waze change objects location with their localization?

The first image is when the language is set to Hebrew, the second is in English. Look at the word " Thanks: " in the image. How Waze managed to change the location of the word to a Right To Left language? With regular localization
Thanks:x
should have been
תודות:X
That's just one example. Waze does that a lot.
Waze supports iOS 4.3 and later so AutoLayout is out of the question. With regular localization I know you can change the content of the word but location? that's a first.
Can I set an if iphone language is English then change the layout to..? (if so that's a lot of ifs.."
Thanks
Frankly, I do not know if there is any standarized way of doing that.
But I see several options:
1. Using localized .xib files or even full storyboards.
2. Changing that programmatically. Get the current localization and add some IFs to the view controller and re-arrange the items. If this is in a custom UITableViewCell subclass then overwrite the layoutSubViews (or so) and change the layout accoring to the locale settings. If you layout it within cellForRowAtIndexPath then apply the localization there.

Resources