user1570600
user1570600

Reputation:

language settings in ios

I have one little trouble. I created a Localizable.string file for a language which is not in the list of available languages in the General settings of the device.

How to force an app to read from it even if language is set to English? I can set Region Format for this country but not the language.

Thanks

Marko

Upvotes: 2

Views: 304

Answers (1)

user1570600
user1570600

Reputation:

After some time spending on that I found solution. In fact the answer was setting Region Format to other language, and than change main file to look like this:

int main(int argc, char *argv[])
{    
    @autoreleasepool {

        if ([[[NSLocale currentLocale]localeIdentifier]isEqualToString:@"sl_SI"]) {
            [[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"sl", nil] forKey:@"AppleLanguages"];
        } else {
            [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"AppleLanguages"];
        }

        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

for setting language to Slovenian. For other language to it similar.

Upvotes: 1

Related Questions