How to change iOS simulator language to swedish - ios

I want to change my ios simulator language to swedish, but i can't find this in settings. What can i do now to get swedish language.

It is also possible to set the language and the region via the scheme settings as seen here:

If you are trying to test an application's localisations then there are easier ways than by changing the language on the device.
You can run the apps with a flag to indicate the country:
i.e for Swedish you can use the flag -AppleLanguages (sv)
Of course, on the simulator or the device, you can't run an app with a flag normally, except for when you are building and running it through Xcode, where you can set the launch arguments for each scheme.
I wrote about this in greater detail, with screenshots, and an example project: https://abizern.org/2012/03/18/simple-localisation-testing.html
This works for the simulator and the device, and you don't have to change any of the device settings.

Choose Svenska. You can select the language through the settings just like you would on a real device. Languages are displayed in the target language, not the current language, as displayed in your screenshot.
Tap the row you want, then tap done (click in the case of the simulator). On device, make sure you can navigate back.

For XCode 12
To do this, tap on the active scheme (the name of your app at the left of the active simulator) and then:
Edit Scheme
Run
Options
App Language

Related

How can I test app localization?

I am testing that a specific app that is in English also works in Hebrew. In iPad Settings, my region is set to Israel, and I've changed the Language Settings from English to Hebrew. I tried restarting the app and the iPad, but the app text is still in English.
Some of the apps on my iPad have switched to Hebrew, but others are still in English.
What am I doing wrong?
See screenshots.some apps are still in English some apps are still in English
You need to change schema run options as described here
https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/TestingYourInternationalApp/TestingYourInternationalApp.html
You will not need to change device/simulator region or language settings.

UITest localized application

I have an application in French only.
In the storyboard, I have a mix of specifics and system buttons.
When launched on a french device, all is good, the system buttons have french names.
I added the arguments passed on launch in my unique sheme
-AppleLanguages (French)
-AppleLocale fr_FR
so, when launched on the simulator, I have the same result than on a french device.
But when I want to test with UITests, the system buttons have english name (ie Edit/Done), so my tests with tap on button "Modifier" or "Ok" doesn't work.
Is there a way to force the device language before testing the application, or have I missed something?
I didn't find a good solution for this problem.
But I saw that the setting doesn't change between two launches of the iPhone emulator. So I changed the iPhone language to French, and it will be OK until I change the simulator's model or I localize the application for another language.

Localization not working on device

I localized my app in french, created Localizable.strings with appropriate translations, as well for the storyboard.
When I run the app on the french device, storyboard labels are translated correctly, but not the ones coming from Localizable.strings.
I printed preferredLanguages() and NSLocaleLanguageCode and they are correct on the device ("fr").
If I force the language "fr" with the Edit Scheme, it works, but if I go back to "System Language", it does not work anymore.
Reading other posts, I also cleaned, delete app from device, reset content and settings on the simulator, relaunch Xcode, ...
I can't see why the app does not use the language defined on the device for the Localizable.Strings !
Thanks for your help...

How can I test my iOS application, using Xcode, in another language without changing my language preferences on my iPhone?

I have an application that I would like to test in another language. Using Xcode is there a way to test the application in another language without changing my language preferences on my iPhone?
It is very simple. In Xcode go to menu "Product" and Alt + click on "Run..." menu item.
This will open schemes. On "Run" scheme open "Options" tab. Select "Application Language" and Run.
Well, not really I guess. The only other way is to implement the whole language choosing possibility by yourself, i.e. give the user (or just yourself as developer) the possibility to change the language manually. But that's really a lot of overhead and you'll probably not want that.
There is no quick other way of doing so I'm afraid :/
You can create instances of the simulator with Xcode 6.1 (windows->devices) , see attached ss.
So, create a iphone-language version. This new 'simulator' is now available in the drop down list of devices when you build and run. Run in that new target device. When your app start, you should see the proper simulator in the window banner as here :
Now go into settings and set the language to your desired target. Should work, but have not tested with an actual multi-language app myself.

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.

Resources