Change language in iOS app - ios

I display content in selected language which comes from the phone settings. Users may change the app language in settings of my app. I use NSUserDefaults to insert selected language to AppleLanguages key with setting objectAtIndex at 0. It works when application relaunches. But inside the app I cant see any change. I used NSUserDefaults syncronize but it is not working.
Simply I want to reload my tabbed app views with chosen language at runtime.

Firstly, this isn't great user experience - languages are there to be set by the user for their personal aptitude. Your app is trying to forcibly dictate a language to them - behaviour that is at best frowned upon by Apple, and at worst will see your app rejected. I know Id definitely delete an app that tried to change one of my settings for me, especially a global one like preferred languages.
That being said, you can manipulate the localisation system by only supporting specific languages - you should never have to support that kind of requirement. Simply limit the supported languages to the ones you are prepared to offer translations for.
Lastly, Id expect that firstly you can't manipulate global settings like that as it breaks the application sandbox, and that secondly even if you could you'd have to find a way of relaunching your app anyway - itself a difficult proposition.

Related

Manual language selection in swift by using picker view

I have a picker view which I want it to change the language of the app, I have localized my app with 3 languages and it switches to different languages when I change device language but how can I use the picker view to change the language of the app ?
I'm using Xcode 7 and swift 2.1
Short answer: You can't. The system is starting your localized app according to the device settings, which you cannot override.
Side note: If you opt to not use any localization features provided by apple and implement everything yourself, you may provide whatever means to change your own language setting in-app. But that is a real pain and you are likely to make mistakes, not taking into account anything.
If you want to go down that road, see semanticContentAttribute to help with problems regarding RTL languages.
Also, please note that this might become a problem in review. Most apps should not need to reinvent the wheel here.

IOS Internalization MultiLanguage change by run time

I have an IOS app and i want to add multi language support. For Example; there are two button first for English and second for Dutch. If user presses the button English the app language change to English. The Dutch button for Dutch language. But there is some constraints. I search for many solutions.
I dont want to use the language option at Iphone "Settings"
The user wont restart the phone to see the changing language.
I need any help, i'm so desperate :(
This question was asked many times.
You can easily implement your own language system. The NSLocalizedString that Apple uses is a macro, which you could change or just make your own macro for localization. That way you can fully control what is being localized and what not and can change it at runtime. See those projects for example: TCLocalizer and DPLocalizationManager.
They both allow runtime localization of your view controllers. And there are many more, such as:
Qlovr/QVLocalization
illoyd/CAFLocalizables
mumensh/iOS-Localization
All these links and libraries should help you figure out what exactly do you need and how to accomplish it.

How to add rtl support to my ios app

I am localizing my app and wanted to add some rtl support as well (my app is currently in ltr).
What would be the best approach for providing such localization? I was thinking of creating different xib's for rtl and ltr, but then how would I load the correct one?
I asked a question similar to yours not so long ago: How does waze change objects location with their localization?
Your best bet would be to use a different xibs \ StoryBoard and differentiate between the two after checking the local settings. You could also ask the user for his native language to trigger the right StoryBoard (some users like to have controler of the language they are getting, even if there phone is in another language)
If you are going to support iOS 6 and there is a way achieving the above with AutoLayout but I'm not sure that's what you are looking for.

Ipad app in different languages

What is the best way to localize my app to different countries/languages?
I would like the user to have an option to select the language he wants regardless of the country he is downloading from.
Thanks
The best way is to provide your application with whatever set of languages is needed.
As for switching, the best way is to actually detect the language and use it. You should not implement some specific language switching method, I mean user should not be forced to choose the language again – (s)he already did during initial set up of the system.

Browser language: autodetect vs user select?

I am designing a localized web app. I am leaning on auto-detect browser language setting. But I notice a number of respectable sites asking the user to select a language. Is there any usability issue you know of (from actual experiences out there) with just auto-detecting user language?
Thanks.
Give me a choice
Remember my choice
Use the auto-detect as default
Make transition easy
In many situation I prefer or even need the "original" over my local one, bad translations or different content being the major reason.
If you register multiple domains, you can base your auto-detect on that: When foo.com redirects me to foo.de, or otherwise shows me a german interface, it is actively ignoring my choice to go to foo.com.
MSDN did insist on showing me atrocious automatic translations and ALWAYS made me click to go to the readable, understandable english one (that's a step up: when they introduced it, the default selection for changing the language was something like Afrikaans).
Make transition easy: i.e. make it easy to go to the counterpart of the current page in a different language. Amazon often succeeds when I change ".com" to ".de", but then it fails to lead me to the german translation of the item. That's not always possible, as that requires each local view having the same structure and a 1:1 page mapping. But generally, you have to weight above requirements against other constraints of the project.
[edit] MSDN got better now :)
I would suggest to autodetect the language and display the site in this language or the default languge (probably english) if the translation is not available. Additionally present the user with a selection of languages on top or bottom of your page. The names of the languages should be written in the target language.
Don't do it like that: English, German, Italian.
But: English, Deutsch, Italiano.
Obviously there is the usability problem that you might detect a language that the user doesn't understand. How are you going to do the detection? Don't think everybody has their browser set to the correct language. IP-Adresses are also a very bad indicator for the users language.
Practical example: YouTube tried to convince me for a week or so to use the Japanese version, though I can't read Japanese. Not very helpful. Microsoft is also determined to serve me automatically translated versions of there documentation when I just want to read the English one.
So don't try to tell your users which language they're supposed to prefer, let them decide for themselves.
I really hate non-configurable auto-detection because a lot of applications are translated more than imperfectly. I would rather read perfect English than bad Russian. For example, some terms do not translate in a reasonable way, and trying to translate everything makes localized version faintly ridiculous.
Also some applications can not translate new features fast enough, leading to a mixed language.
So I always prefer to have a choice, and choose the version that is native to the application author -- for the best language (unless it is a language I do not know).
Update:
One situation when it has gone beyond ridiculous is DB2 (or its client tools, not sure), which forced me to install a Russian version, but all errors in this version were shown as "???????? ??? ??? ??".
Yes: at work, we have a Windows XP deployed with 'English' language (because we have worldwide site and only one kind Windows to deploy with only one kind of settings when it comes to language).
Yet all out applications must run in French. The auto-detect feature alone would not be enough for an appropriate display of the labels.
Sometimes when you are trying to describe something to a user over the phone and you are in a different location, it is very annoying when you are both looking at the same URL, but see different results. You might even go so far as to include the language in the URL similar to how wikipedia does it (e.g. en.wikipedia.org).
Also sometimes a user will be on a friend's computer and try to access a website but won't see it in their preferred language, because of the language settings on the computer.
I think the best solution would be to allow the user to override the setting, but default it to the auto-detected language.
I agree that the auto-detect is not enough.
Not many users know the settings for selecting their language. Therefore the settings will often be the default and therefore incorrect (for non-english users).

Resources