🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
MHSDK目前支持中文和英语两种语言 MHSDK currently supports both Chinese and English 可以通过在Application和Activity中修改context中的语言配置来切换语言,由于Appliction和Activity中获取的context是不同对象 所以都需要修改 You can switch languages by changing the language configuration of the context in Application and Activity, which need to be changed because the context obtained in Application and Activity are different objects 示例代码如下: Example code is as follows: ~~~ Resources resources = getResources(); Configuration config = resources.getConfiguration(); DisplayMetrics dm = resources.getDisplayMetrics(); config.locale = Locale.ENGLISH; resources.updateConfiguration(config, dm); ~~~