Context:
We are developing an iOS app that has the word Math/Maths in it. This needs to change depending if the device's language is English or British English.
Problem:
So, I have two InfoPlist.string files for en-GB and en-US and in the iOS simulator the App displays either an en-GB or en-US App name depending if the language was set to English or British English. However, it's very glitchy (sometimes working, sometimes not) and according to Apple's Dev guide it's not (or shouldn't be) possible! That's not to say the doc isn't outdated or wrong.
From: https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/Articles/LanguageDesignations.html#//apple_ref/doc/uid/20002144-BBCEGGFF
Important: In iOS, the bundle interfaces do not take dialect or script
information into account when looking for localized resources; only
the language designator code is considered. Therefore if your project
includes language-specific project directories with both a language
and region designator, those directories are ignored. The bundle
interfaces in OS X do support region designators in language-specific
project directories.
Am I on a wild goose chase and it's not actually possible or it is, and just very buggy? If it is possible, how?
You are right. It is not possible automatically. For localizeng the os looks for the language, not for the region. So it just takes into account the en. But the good news is that there is a indirect solution which requires little effort: check the approved answer here.
Related
I'm developing an internationalized version of my Cordova+Ionic app for iOS. The current app name is in Swedish, and I want to keep the name for the Swedish market, but the international app will have a new name.
I need the app to have the Swedish name for all users in Sweden, regardless of the chosen language. Is it possible to localize the app name based on region only?
I know you can localize it using a InfoPlist.strings resource with CFBundle(Display)Name properties, but the locales used to determine what resource to use are (as far as I'm aware) solely based on the devices preferred language/locale setting and takes no consideration about the device's region setting.
For instance, the resource for the en-GB locale (located at en-GB.lproj/InfoPlist.strings) is loaded when the preferred language is set to English (United Kingdom), but not for English with region set to United Kingdom.
Thanks
No, currently that is impossible
This is the extract from the documentation:
First, the bundle determines which localization to use for the application as a whole. If a .lproj folder exists for the preferred language, that localization is used. Otherwise, the bundle searches for an .lproj folder matching the next preferred language, and so on, until one is found. If there is no localization for a preferred language, the bundle chooses the development language localization.
I have added two language localisation in my iOS project
Spanish(es)
Argentinean Spanish (es-AR)
In my iPhone language setting i have checked 'esponal' but it loads the Spanish(es) strings.
Now i need to check the Argentinean Spanish too. So what settings i need to do in my iPhone to check Argentinean Spanish.
You need to set the iPhone region settings to Argentina.
Edit:
Actually, it look slike this is not supported on iOS:
Important: In iOS, the bundle interfaces do not take dialect or script information into account when looking for localized resources; only the language designator code is considered. Therefore if your project includes language-specific project directories with both a language and region designator, those directories are ignored. The bundle interfaces in OS X do support region designators in language-specific project directories.
https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/Articles/LanguageDesignations.html#//apple_ref/doc/uid/20002144-BBCEGGFF
I am creating an app and I have some translations.
The app is programmed to detect the ios language and most of the languages are in the settings, except Slovenian.
Is there any other way to do that.
Perhaps read region format?
Or, how to add a list.
While the OS itself my not support the language (iPhone Language setting) you can still use the below option in Settings to Add Language… to add the language to your preferred list of languages. Then if an app supports that language it still will even if the OS does not (ie. The OS's strings aren't translated).
When I create a localization for fr-CA and then switch my iPad to use that language and region, it still uses my English localizable.strings file. If I just create an fr localization and switch the iPad, however, it works fine. Any ideas on what might be going wrong? Are my settings on the iPad correct (see screenshot)? Any other suggestions?
From:https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPInternational/Articles/LanguageDesignations.html
Under “Language and Locale IDs” it says the following:
Important In iOS, the bundle interfaces do not take dialect or script
information into account when looking for localized resources; only
the language designator code is considered. Therefore if your project
includes language-specific project directories with both a language
and region designator, those directories are ignored. The bundle
interfaces in OS X do support region designators in language-specific
project directories.
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.