iOS - Device language not recognized for localization - ios

I have an app with multiple embedded packages using their own localization files. The app doesn't seem to be picking the localized strings when I change the device language/region, but if I change the language for the app from iPhone Settings -> App -> Language, the language is recognized properly and the correct strings are shown.
Does anyone know of a fix around this? Or if it's a known iOS issue somehow?

Related

Localisation inside an iOS app without changing the system Language

There is an option in my app that will enable the user to change the language of the app which can be different from the system's language.
The app has to be localised according to that language instead of the device's language.
I have found couple of solutions like this one but I couldn't find a solution that will work for storyboards an base localisation.
How to achieve this?

iOS app not using the only localization available

Good morning,
I have an iOS app with English and Hebrew localizations and a device set on English.
I need to build the app with Hebrew only for this version (so the app will launch in Hebrew).
I tried to delete en.lproj and remove the references in Xcode, but the app just uses the base localization in the storyboard and the string I use as a parameter in NSLocalizedString, instead of the Hebrew files.
I've also tried to change the development language to Hebrew: How do I change the Development language in Xcode before internationalizing my app?
but that didn't help.
When setting NSUserDefaults-AppleLanguages key in main() it works but not on the first launch.
I would love to use a different implementation for NSLocalizedString so I could manage the localizations myself, but the problem is that English is written from left to right and Hebrew is from right to left, so updating the strings is not enough.
Do you have any idea how can I force the app to launch for every device in the localization that I choose?
Thanks!
I think that I found what was the problem, I left a single image localized in English.
It seems that when there is anything localized to a language, it adds the language to a list of supported languages. Because the device is in English and the app "supports" it, English will be used.
If anyone knows a way to modify this list of supported languages without deleting files, and making it work from the first launch, and maybe even having a different list for each target, please let me know!

(Base) localization not working in iOS 7?

It seams base localization does not work on iOS7?
I have an app (its available on the app store) that has localisations for Dutch, Chinese and a base localization = English. This looks like this in xcode 6:
The plist file contains the "Localization native development region" key:
Problem:
When the app runs on on iPhone iOS7 configured for English, it
uses the Dutch localization ?! I would expect that iOS uses the base
localization since its configured as English?
I do not have a "development language" entry in the Localizations
section of Xcode, I have seen this in some posts, what is the meaning of this "development language"? And could this be a possible cause or something?
I can solve the problem by adding an localization language "English" (which then seams to become the development language, I have tested this) but this would simply be a duplicate of my "base" language. Surely this is not the way to go?
I know there are many topics on localizations already but I have read them all (I believe) and cannot find a clear answer.
1.Localization native development language states the preferred language to be use if the iOS language and your app languages doesn't match, so I'm thinking about a storyboard that has been localized in english and a strings file in english, to make your app use english language.
2.Development language is not the same of the first point, is the base language, by default is set to english and it doesn't seems to exist a clear way to change that (I've filed a radar to Apple about it asking for xcode to show a menu at the beginning of each project). To change it you need to do it manually, but appstore will always show english as language
3.This is the solution, when iOS doesn't find a suitable localization it iterates through an array of laguages until it finds an existing one, if you add an english localization you could solve the problem.
Appstore reads directories in your app bundle

iOS localizable.strings stops working after first run

I'm facing this weird problem (both on simulator and device):
My app is localized in many languages, if I build and run the app on the device (as well as on the sim), and the app was not installed, everything seems fine, but than, if I build and run again without removing the app, or if I close and reopen the app manually, the it gets localized in italia as if there is no localizable.strings file and the only language is italian (I'm italian, but both my mac and my Device are in english).
Here's a flow:
1) The device is in Italian -> I build and run the app -> it is localized in italian as it should be.
2) I close the app -> switch the language of my iPhone to english -> reopen the app -> the app is still in italian.
3) I delete the app (with language set to english) -> I build and run the app -> the app is in english as it should be.
4) I close and reopen the app (or build and run again) -> the app switches back to italian even if the device language is in english.
than there's no way to get to english again unless I delete and rebuild the app, and it just works for the first time.
Any idea on this strange behaviour? I'm looking around but find no hint to solve this problem.
In my tests (which have only been on the simulator), you need to either:
A. Turn on/off the device after changing the language
B. Delete the app and reinstall after changing the language
In order to see the language change take effect. I would try turning the device on/off and changing languages settings and see if the language sticks this time.
There was an error in a framework I was using which was setting programmatically the property AppleLanguages to "it" in the user defaults.

InAppSettingsKit Localization works in Settings.app, but not in my App

My app supports four (4) languages, (en, es, fr, and de).
My Settings.bundle is configured as such:
Settings.bundle
- Root.plist
-en.lproj
--Root.strings
-es.lproj
--Root.strings
-fr.lproj
--Root.strings
-de.lproj
--Root.strings
Each Root.strings is exactly the same with the exception of the string values being localized.
All of this works as I would expect (in the simulator). As I switch languages in Settings.app->General->International->Language, the Settings.app portion of IASK displays the appropriate language.
In my app however, I only get English regardless of the language setting I selected.
Does anyone have any suggestions where I should look for help on this?
Thanks in advance!
Make sure that you have xx.lproj folders also on the root level of your app. The OS uses these to determine the available localizations of an app.

Resources