IOS Localizations Global - ios

Its been a couple of years since I worked on IOS, but now that I've created one with the latest Xcode 5.1 I see that there is a "Global" localization. I've always assumed that if the user has a localization that it is not supported by the app, that it will revert to the Localization native development region property in the info.plist.
Has this changed ? and what does the global do exactly ?

Global localization? Do you mean perhaps "Base localization"?
The question is really too broad to answer in the SO format. In short, however: base localization (coupled with auto layout) allows you to you use your reference language (usually your native language) in your storyboards and xibs. When you add a localization to your app, Xcode generates a strings file for all the text that is contained in each UI file.
Good starting point to read up on the new localization guidelines: Apple Developer Internationalization guide

Related

How to override current language used inside an app

I've found testing localizations to be a slight pain since I have to go and change the device's language in order for the app to change.
How can I make my app "think" I changed my default language? I could then link that to a button or popover, but the actual changing of the language is the tricky part.
You can test the with any of the supported languages or regions by settings then in the option of the run target.
This fully described in Internationalization and Localization Guide

Change localizations of base storyboard to german swift xcode

I have an App which is nearly done and I only need to add localizations to it. The problem is that I have written it completely in German (because I am from Germany) and I don't have changed the development language. That means xCode thinks that everything I have done is written in English and not in German:
I have tried to set the CFBundleDevelopmentRegion to German and also to set the Localization native development region (in target) to german but nothing worked.
So my basic question is: I have an app written in German and how can I add an English and maybe other language support?
I was fighting with this for a long time but finally I think I found a solution for Xcode 7.
In general If you're developing language is different than English you have to make 2 things. After you create a new project in Xcode 7 quit Xcode and go to the terminal.
Edit the file in your project folder with your favorite text editor:
vi <your_project_name>.xcodeproj/project.pbxproj
Search for the key: knownRegions.
You should find something similar to:
knownRegions = (
pl,
Base,
);
Put your development language code on the first position. In general position is not important but I prefer that my native language be first. In Your case put there de. By default the first language in new project is en.
Next you should look for developmentRegion (in the same file) and change its value to “Polish" or whatever language you are using. In your case "Germany". What I noticed this makes Xcode to notice that your Development Language changes from English (default) to your language. After those changes save and exit text editor. Start the Xcode and point your eyes to Project -> Info tab. You should see something similar to this with Your native language set as Development Language.
Now open Info.plist. Edit the CFBundleDevelopmentRegion key and set its value to pl or de in your case.
Thats all. Now Your Base.lproj can contain resources in your native language. If you want a new Language just add it as usual.
Let me know if it working for you. I don't know how this little trick change your current project with existing translations but this is good point if you're starting new project.

can I change an app's language based on an iOS Device's default language?

I have Created one simple in-house app for ipads. I would like to have 2 language for that app. Based on ipad default language App language should be same as ipad default language.
I tried to goggling it but didn't find proper answer.
Is it possible?
How can I do that?
Any Links, examples any documents?
You can use TSLanguageManager SDK in order to do that. In basic, you define different string for each languages. Then the SDK checks your language and converts your defined strings/view elements into that language string. Also, you can switch between language by using this SDK in your app.
This is a good starting point for internationalization and localization resources for iOS apps.

How to localize iOS (iPhone/iPad) app using only single storyboard?

I was wondering if somebody could explain in the details how I can localize an iOS app using only 1 storyboard. I know how to localize by creating several storyboards(one storyboard for each used language), however I'd like to find out another solution.
Thanks.
The tutorial on raywenderlich.com uses two forms of localization together. The reason is he also checks the storyboard when turning on localisation in image 3:
.
So then what?
NSLocalizedString is very useful, any text set programatically can (and should) be localised using this method. Ray's tutorial is still very useful.
However, it's not very desirable to create a clone of the storyboard(s) to do translation, it's just not very maintainable in the long run.
And what about storyboards?
The magic happens using the Base Localization feature. Base localization uses the generated objectId's to 'map' different languages to the storyboard.
Do note that this feature is only available using SDK 6.0 and above. Running the app on a lower iOS version will not cause any errors, it'll simply won't work.
Go to your project, and select Base Localization, then add any other language.
Open your storyboard file and check the new language as well. Note the icon is not a storyboard icon, but a simple text file icon. That's a good thing; it won't copy the whole storyboard this time :).
Note how there is now another file 'under' the storyboard. Xcode automatically generates a file for every language you select.
You can se Localization feature for this. You need to add the Localizable.strings file for each supported language and use it for locaization.
You need to use : NSLocalizedString() for fetcing data corresponding to each key.
Check this tutorial for details.

iOS - Storyboard - localization - After modifying storyboard, how to sync to other language storyboard?

I know how to turn on storyboard's localization. The problem is I don't know how to sync all localizaion storyboards, after main (English) storyboard is modified.
Is there any shortcut to sync them? Do I have to do all those modifies again and again in over TEN language storyboards?
My condition is: I have a project with over ten localizations. After I released it on AppStore, we have new user requirements.Then, we start program next version app. After I completed tons of improving and creating on stroyboard, I feel desperate to facing other language storyboards.
If you are using iOS version >= 6 (and Xcode >=4.5), you can use a single storyboard for multiple languages, i.e., do base localization + the usual string localization. Doing so, you have only to care about the localized strings in string files.
For a guide, see e.g. here.
If you're targeting iOS 6.0, you can use Base.lproj like Matthias mentioned.
If you're targeting a release prior to 6.0, you can use ibtool's localization merging features. They works for NIBs, XIBs and Storyboards. You can invoke them like this:
ibtool path-to/development.storyboard --local-
ize-incremental --previous-file path-to/development-storyboard-localization-was-based-on.storyboard --incremental-file path-to/previous-localized-storyboard.storyboard--write path-to/updated-localized-storyboard.storyboard
What that does is open development.storyboard, copies it, and the compares all localizable properties between path-to/development.storyboard and path-to/development-storyboard-localization-was-based-on.storyboard, if those properties are the same, the counterpart value from path-to/previous-localized-storyboard.storyboard is copied forward to path-to/updated-localized-storyboard.storyboard, otherwise the current development value is left in place.

Resources