2

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

4

1 回答 1

1

在花了一些时间之后,我找到了解决方案。事实上,答案是将区域格式设置为其他语言,然后将主文件更改为如下所示:

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]));
    }
}

用于将语言设置为斯洛文尼亚语。对于其他语言,它类似。

于 2013-01-18T08:58:48.927 回答