Far*_*ouK 4 swift widgetkit swiftui ios14
我试图根据应用程序语言加载小部件的不同配置,但是当我使用类似以下内容时:
Locale.preferredLanguages
Bundle.main.preferredLocalizations
Bundle.main.localizations
Run Code Online (Sandbox Code Playgroud)
所有这些都仅在 IntentExtensionTarget 中返回“en”。
这是我使用代码的示例:
extension IntentHandler: ReciterAndSurahIntentHandling {
func provideSurahOptionsCollection(for intent: ReciterAndSurahIntent, with completion: @escaping (INObjectCollection<NSString>?, Error?) -> Void) {
Locale.preferredLanguages
Bundle.main.preferredLocalizations
Bundle.main.localizations
// All of them return "en" only, and I have multiple localization for the app.
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2637 次 |
| 最近记录: |