文章

Ios国际化接入方案

https://juejin.cn/post/6844903716928094215

https://www.jianshu.com/p/88f39aa8e09c

https://github.com/mac-cain13/R.swift/tree/main

https://www.jianshu.com/p/1550f2835f4f

https://www.jianshu.com/p/274848cb37f3

https://github.com/marmelroy/Localize-Swift

https://juejin.cn/post/6844903716928094215

https://developer.aliyun.com/article/459143

https://www.jianshu.com/p/1550f2835f4f

UserDefaults.standard.object(forKey: “AppleLanguages”)

- 0 : zh-Hans-CN

- 1 : en-CN

- 2 : ja-CN

Locale.preferredLanguages

- 0 : “zh-Hans-CN”

- 1 : “en-CN”

- 2 : “ja-CN”

Locale.current.languageCode = en

bundle相关获取的是当前bundle支持的strings配置语言

Bundle.main.preferredLocalizations = [en]

Bundle.main.localizations = [en]

本文由作者按照 CC BY 4.0 进行授权