It was established in a previous question Localizing system generated privacy alert message iOS UIAlertView Xcode that the permission alert "The AppName would like to access your photos" is shown and localized by the system and not by the app. So when changing International > Language settings, this alert is seen by the user in their preferred device language.
However, localization doesn't apply to other aspects of the app for other system generated information. For example, in testing an app on a device with International > Language settings set to French:
(Image below left to right.)
Displaying an action sheet = system generated message displayed in English
Selecting "assign to contact" the contacts permission alert = system generated message displayed in French
Trying to access contacts when privacy is off, error message = system generated message displayed in English
Even though French is set as the system language, the app still displays English, or more correctly a combination of English and French. This isn't a consistent user experience.
Questions:
1 - What is going on, why is this inconsistency occurring?
2 - How can this inconsistency be corrected so that all system messages displayed are in the language specified by the system settings?
3 - Does this have something to do with localizing the app storyboard and if so, how can that be achieved for all languages possible that the user may be using on their device?
Related
I am working on app, and customers want it to be fully localized. We have several Localizable.strings and InfoPlist.strings files for each supported language.
There is an opportunity in the app to change app's language "on fly".
(This is done by associating another bundle with chosen language)to main bundle. So when app calls [NSBundle.mainBundle localizedStringForKey:value:table:], it actually refer to bundle with language user has selected.)
Here comes bad consequences. System permission alerts (requests for location usage, camera usage, etc.) are not localized with language selected within the app, but localized with preferred language from iOS Settings.
So, for example, if user has English as preferred language in Settings, but in our app he chose French, the whole app will be in French except system alerts, which will be in English.
Is there any way to fix it? I mean, to choose programmatically which language system alert must consider as preferred?
Apple Rejection Reason: Your app's modal alerts are in English, but your app's primary language is French. To help users understand why your app is requesting access to a specific feature, your app's modal alerts should be in the same language as the rest of your app.
I have an app that support both Chinese and English, and when my phone is configured to Chinese or English, things display quite normally, but when my phone is in French(by default the interface would be in English), everything is in English EXCEPT the UIActivityViewController is in Chinese that will pop up once user click a "share" button in my app.
I do not know how to modify this, any helps will be appreciated.
Note: my app uses a Localize-Swift library which allows user to choose a desired language from the settings within the app which means the app language could be different from the system language, if user chooses one from the app then switch to another system lang. Also, English IS set to be the development language in Xcode and Base Localization is NOT used.
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.
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/
I change the language of my device something different than English, but GameCenter dialogs still appear in English. I mean:
Sign in to Game Center
Use Existing Account
Create New Account
Cancel
Welcome back xxx!
etc...
Game Center app works perfectly in localized device language, but dialogs in my app is still in English.
I suppose those messages and menu texts should appear in device language? Am I wrong?
I can't find anything on Apple refs about this.
Is this happening beacuse I am in sandbox mode?
Or do I need to set GC language in the project?
I tried restarting device.
At last i found it. My assumption is wrong in the first place.
Gamecenter messages and menus are not affected by the device language but, by the xib's localization.
I just edited the xib file's folder which is localized in english by default.
renamed en.lproj >> xx.lproj (here xx is the local language code)
and readded files to the project.
All gamecenter messages and menus are in local language now.