1

我想以编程方式更改当前的语言环境。我尝试在stackoverflow中搜索并找到了这种方式。

[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];

但我的问题是如何将其设置为 currentLocale,但 [NSLocale currentLocale] 返回 currentLocale。但是我该如何设置呢?

在这方面需要一些指导。

4

1 回答 1

0

I think you can change language programmtically so that Locale will change accordingly.

UserDefaults.standard.set(["en_us"], forKey: "AppleLanguages")

although i didn't get time to try this solution(In swift)

于 2018-10-29T10:46:45.793 回答