无需重新启动应用程序更改系统语言时,某些字符串没有翻译 [英] Some strings are not translated when changing system language without restarting app

查看:177
本文介绍了无需重新启动应用程序更改系统语言时,某些字符串没有翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在哪里,如果我打开我的Andr​​oid应用程序,然后进入系统设置更改语言,然后再次打开应用程序,在应用中的一些字符串将不会被翻译,除非应用程序是强制退出问题并重新启动。任何想法,为什么出现这种情况?我没有的android:configChanges 设置为区域设置在我的 AndroidManifest <任何地方/ code>,所以并不意味着这一切活动应该对自己的重新启动?

I'm having a problem where if I open my android app and then go into the system settings to change the language and then open the app again, some strings in the app won't be translated unless the app is force quit and relaunched. Any idea why this happens? I don't have android:configChanges set to "locale" anywhere in my AndroidManifest, so doesn't this mean all activities should be restarted on their own?

推荐答案

终于想通了这个问题。那些没有被翻译字符串正在静态类内填充。所以,因为这个类只被实例化一次,串并没有获得再次用正确的译文重新填充。

Finally figured out the problem. The strings that weren't being translated were being populated within a static class. So because this class was only being instantiated once, the strings weren't getting re-populated again with the proper translations.

这篇关于无需重新启动应用程序更改系统语言时,某些字符串没有翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆