Localization IOS default Language - ios

I have build an iphone app and I started with Dutch texts in the app. I would like to expand it to other countries so I Localized the app and added English.
So I have now to localization folders en.lproj and nl.lproj.
When I install the app on the iphone and set the language to Dutch I get the Dutch language in the App. When I switch to English I get this. But when I switch to German I get the Dutch language. I would like to have default the English language when the is no localization folder for it.
How do I do this?

A little late to the party, but just recently run into this issue and somebody helped me, so here is the magic:
Suppose your app supports English and Spanish.
If the list of languages in the Settings app is Portuguese, Spanish, English then Spanish will be shown to the user. If the list has been Portuguese, English, Spanish then English would be shown to the user.
In short, the language are loaded in order, so if you want English to be loaded when German (or any other missing language) is set, your settings screen should read:
German | English | Dutch | everything else
But you don't know how your users has the languages set and English might be at the bottom. So far, the best solution workaround I found was to manually change the Locale order on startup so English is always second, and therefore, default.

In your Info.plist you have to set the Localization native development region to English (en) and it should work fine.

Related

How to set base app language is Chinese Traditional in Xcode?

I need to set base language to Chinese, not English.
When I change device language to Japanese, the app also show Chinese, not English.
So, I open project.pbxproj and change developmentRegion to Chinese.
And also set Localization native development region in info.plist to China.
I run my app, the language also show English.
Have any idea to set base language?
Take Objective-C as example
Basically the localization form is NSLocalizedString(<#key#>, <#comment#>)
If you want your basic language is Chinese, then you should take the Localization key as Chinese instead of English. for example NSLocalizedString("你好", nil)
You will get "Hello" when App Language is English if you have specified some language, eg. English, in Localization file as "你好" = "Hello", if not, you will get "你好" by default.

Localization in Swift, Base, German, English, what's the correct way to do it?

I have a project which is nearly completed.
The language I used in Storyboard and in code is German. I use Base localization (which is German because the Strings in Storyboard and Code are German). The App is also localized in English.
Basically I want that every non-German user can use my App in English but I also want to use German language in Storyboard and code.
For that, I set the Base localization to English (I set the language to "EN" in project.pbxproj, and I set the language to "United States" in the Plist file).
What I want is working but I think this is not the correct way to do it because in my current configuration Xcode thinks that my Base is English (because I set it to English) but in fact it's German.
If I would set the Plist file and the project.pbxproj file back to DE users which are not German and not English would have to use my App in German. Or am I wrong?
What's the correct way to achieve that German users can use my App in German and all others should see the English version.
I think you should set the base language to English, add German for additional languages, so the APP for any users uses German on the phone will display German. Otherwise, the APP for all users who do not use German will display the base language, which is English. I hope this will help you.
Check this to set up the development language on XCode.

Default language not working in iOS app

I have such problem:
I have localized my app for two languages - English and Polish, with English being set as the Base one.
I set developmentRegion to "en" (also tried "English") in both info.plist and project.pbxproj files.
My translated texts are contained within localized Main.strings and Localizable.strings files.
So everything should be fine, yet when I set any language other than Polish or English the app does not fall back to the Base (English) one, instead stays on the last used, supported language. (i.e. Polish if I recently changed from Polish to lets say French).
Can anyone help me ?
Ok I see now. I thought that whatever unsupported language I would set in system settings, my app would always revert to English (Base).
That's not true.
When selected language is not supported then the app is taking the language that is the highest on "Preferred languages" list in system settings. Only if none of these preferred languages is supported, then the base one is selected.

How does localization works for languages and countries?

What I mean is this: suppose I localize my app to french (not specifying a country), will that version be used by any one that is using variations of that language?
French is spoken by more than 30 countries worldwide. Lets take Switzerland for example, where french and german are official languages. French for Switzerland is localized as fr-CH and will have that folder inside the application. If my app is localized just for french, will a person in Switzerland with a device configured for fr-CH see the french version or the default one?
If you go to the iOS settings, you'll see only one option for French, there's no variation. So you can just use fr.
I had an app localized for Brazilian Portuguese, when it should be Portuguese (pt) instead. pt-BR wasn't working. So be careful. You may want to try and change few strings and see what will come out.

How to use a language other than english, but still use NSLocalizedString with english?

I couldn't find any similar questions, so here we go:
I am working on an iOS app that for the first release will only be in french, but we plan to release an english version as well in the future. At this point, I thought it was a good idea to use NSLocalizedString for all the text, so that the app will be ready when the english language will be required. However, I would really like to use english as the key value in my code:
aString = NSLocalizedString(#"Yes", #"Text for positive answer");
instead of
aString = NSLocalizedString(#"Oui", #"Text for positive answer");
Then I want to run genstrings, and localize the .strings file in french (and give it to the translators). But if I do it like that, how can I get rid of the "original" english .strings file? Am I totally wrong here, and do I have to use french for now in my code?
If you are developing the app in English and localizing it into French, I wonder why you would want to actively prevent the app from running in English. If some users in your target market (France only, I imagine?) prefer to run their iOS device in English language, why deny them their preferred language? Or is it because you won't be doing QA of the English version and therefore don't wish to expose it yet?
In any case, I believe that you can restrict the list of supported languages by simply editing your project metadata. In XCode the list of supporting languages is shown on this page -- simply remove English and I believe that your English localizations, even if they are present in your project, won't be used (I haven't tested this but I doubt it would delete your existing English files, it should just remove them from the application's supported languages list)
You can do your whole project in english, keep english words for keys in the localizable.strings files, but keep only the fr.lproj folder, and in the plist set the supported languages only to french.

Resources