Reputation: 145
I've done this so far:
But I still get language set to english:
Does anyone know if I'm missing something?
edit:
If I do this:
- (void)logAllLocales
{
NSLocale *curentLocale = [NSLocale currentLocale];
NSArray *locales = [[NSLocale availableLocaleIdentifiers] sortedArrayUsingSelector:@selector(compare:)];
for (NSString *locale in locales)
NSLog(@"locale '%@' is: %@'", locale, [curentLocale displayNameForKey:NSLocaleIdentifier value:locale]);
}
result:
‘sv’ is: Swedish’
‘sv_FI’ is: Swedish (Finland)’
‘sv_SE’ is: Swedish (Sweden)’
I'll get three swedish locale options so technically "sv" should do. But I also tested the other options without luck.
But if the simultor need a reset to change the Lanugage then I think my question is answeded. It's not possible with arguments passed in on launch. =)
Upvotes: 8
Views: 11543
Reputation: 20234
I have Xcode 13.2.1 & was able to configure the app language by modifying the scheme options.
The app will launch with the language settings you provide.
No need to change it manually from the simulator setting.
Credits:
Upvotes: 2
Reputation: 145
As said in my last edit. I think this is not possible since the simulator must reset to actually change system language.
Upvotes: 0
Reputation: 6275
It's the same procedure you use in physical device. Go in Settings > General > International and change the Language from English to Swedish
Well the thing is that I deploy to simulator a lot. And before every deploy I usually want to clean the whole simulator with a hoy-key: I've connected "Reset Content and Settings..." to cmd+K. This makes the simulator reset back to english language even if I set it explicitly via the very obvious way pointed out below. (Settings > General > International) I really want it to be an argument passed on launch. Its a very tedious way to do it manually every single time, especially when Im working only with swedish, norweigan and danish at the moment. =)
Try to replace in Localizable.string (En) the entire content with the Swedish / Norvegian and Danish content. So the simulator is in English, read from English string file but show content in another language.
Upvotes: 5
Reputation: 4437
If i got you right, to change the simulator language you just need to change it from the "language" option on simulator screen shot that you have attached. tap it and select the language that you want.
Upvotes: 0