How does an iOS app know the final user's language choice? - ios

Let's suppose we've translated our application to a new language and we have the localization files in our project.
Now, how is the app going to know the language of the final user?
Is the app going to change the language depending on the settings of the iPhone/iPad?

The app determines which language to use based on the Region and Language set up by the user.

iOS 13 and newer support language selection on a "per app" basis.
Apple Developer News: How to support per-app language settings in your app
Although, I have noticed the "per app" language selection capability may not itially be visible to the user ...
Starting with iOS 14, if a "per app language setting" via the Settings app is not accessible, then some second language for the device in Setting > General > Language & Region needs to be added. After any second language is added at the device level, then all language choices for the app are visible in the Settings > Some Example App > Preferred Language section.

Related

How to get/set the iOS "preferred language" from a RN app?

We are developing a React Native app supporting three languages. For various reasons, we must have specific language selection logic in the app and a language selector within the app.
In iOS 13 there is a new "Preferred language" selector in the system settings for the app. We would want the in-app language selector to change the preferred language, and conversely that the user could also change their language in the system settings.
How can I read/write the iOS "Preferred language" in a React Native app?
The preferred language setting cannot be explicitly fetched or set. Changing the preferred language appears to the app just like the whole system language is changed to the selected language.
We implemented in-app language selection so that the app uses the system language until the user explicitly changes the language in the app. Thus, if the user changes the preferred language, the app language changes. After the user changes the language in the app, the preferred language no longer matches the app language and changing it has no impact. (The user knows where to find the language setting after they have changed it once.)
You simply add it to Xcode (see image).
Then grab the languages in your app by using react-native-localize

iOS Localization: simulator behaves differently than device

I have set up 2 languages in my app:
English (development language)
Italian
I am expecting that in case the device is set to a language different than Italian, the app would come up in English.
However I noticed an inconsistency, between simulator and device:
If I set the simulator to Spanish, the app comes up in English
If I set the device to Spanish, the app comes up in Italian
how can I make sure the app comes up in English when the device language is set to Spanish?
I believe this inconsistency is due to the preferred language order in Setting App -> General -> Language & Region. Your iPhone device is likely to have ordered Italian with higher preference.
As stated in Apple's documentation (https://developer.apple.com/library/ios/qa/qa1828/_index.html)
To determine the language for your app, iOS considers not only the order of the user language preferences (in General > Language & Region of the Settings application) but also the localizations your app declares it supports. Here is the detailed process:
iOS first looks up your user's most preferred language, which is the first entry in their language preferences.
It proceeds to check if that language is supported by your app. iOS searches your app bundle for an .lproj folder matching the preferred language. If the folder exists, iOS infers that your app has been localized for that language and chooses it for your app. Otherwise, iOS selects the next language in the user language preferences, then repeats the above check.
The dialect support in iOS may slightly change the above behavior. If your user's preferred language is a regional variant that is not supported by your app, iOS will try to fall back to a more generic language before giving up. For example, if your user's preferred language is British English and your app bundle doesn't contain an en-GB.lproj or en_GB.lproj folder, iOS then searches your bundle for an en.lproj folder and chooses English for your app if the folder exists.
If none of the user’s preferred languages are supported by your app, iOS chooses the language matching your app's development region (CFBundleDevelopmentRegion).
In Summary,
a. For user who knows both Italian and English, it will display in their
preference.
b. If they only know one of the two, it will display the correct one.
c. If they don't know both, you should set CFBundleDevelopmentRegion in your info.plist to select English.

How can i change the app settings language based on selected app language in ios.?

My app supports 7 language. when the user selects from the choice i will restart the app so that app changes to the selected language. But i need the app settings such as settings bundle to be updates as per the app language.I can able to localise the settings based on device language but not on selected app language.
The answer might be a hard NO for it. Inter-App communication doesn't let you localize the native apps.
App is localized to spanish but device is set to english then
If your app is showcasing address then book english is shown.
If the app is using camera then english is shown (unlesss you create
custom camera interface)
If app is triggering social framework like Facebook,twitter etc they
also shown in english.
Here in your case the Settings screen can be localized just in the same way that info plist localizes, but screen will localized only when the device is set to that language. http://useyourloaf.com/blog/localizing-iphone-app-settings-strings/

Build Settings : What changes should I do in the build settings so that on releasing the app it will show the languages on App Store as only English?

I have committed some kinda mistake in uploading an iOS app, which makes my app show the languages as English and German on AppStore.
The scenario is that I have set the "Localization native development region" key in (info.plist of target) to Germany, while my app is actually an English app(for all territories). But I am not confirmed that changing this key to US, can change the Appstore language of the app to only to English.
Besides this, I have also set the language in Localizations in the( info of Project) to:
1. English - Development Language
2. German
What changes should I do in the settings so that on releasing the app it will show the languages on App Store as only English?
After doing an experiment with uploading an application to app store, I came to know that for the languages of the application we need some settings changes in the info.plist of the project(remember not the target).
For eg. For Multilingual(English and German both) apps. It should
show only these two languages in the App Store. Otherwise the user might get irritated after downloading the app when he see the content is in single language.
Just go in the localization as shown in screenshot above and click on + to add
a language and - to remove the language.
Also this localisation language setting creates a folder named "de.Iproj" or "en.Iproj" for respective languages. That folder must also be removed from the build if the corresponding language localization does not exist

Change language of iOS app in App Store

In App Store my iOS app is declared as "Language En" but it should be "Language German". How can I do this? In iTunes Connect I set the language to German, but it doesn't work. What do I have to set in Xcode do make the app declared as german?
Set CFBundleDevelopmentRegion to de_DE in your project's xxx-Info.plist.
From Apple's docs:
CFBundleDevelopmentRegion (String - iOS, OS X) specifies the default
language and region for the bundle, as a language ID. For example,
English for the United Kingdom has the language ID en-UK. The system
uses this value if it cannot locate a resource for the user’s
preferred language.
for more info follow this link.
You can't do that from iTunesConnect. The language is read from your IPA and the default language for base language is english. I think that this is a pretty nasty issue and I've filed a radar to Apple asking for a language selection during the creation of a project.

Resources