且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是Android中使用的字符串翻译的目的是什么?

更新时间:2022-05-30 05:21:57

该属性指出,此属性将是所有区域设置相同。为什么是它有用吗?

This attribute points out that this attribute will be the same for all locales. Why is it useful?


  1. 本地化文件是人类和节省时间,更具有可读性。

  2. 它告诉皮棉工具,一切都很好,而且Android不需要寻找此资源的翻译。

完整的解释:
http://tools.android.com/recent/non-translatablestrings

所以,一般情况下,这意味着如果不把这个属性,你应该始终本地化此资源,否则,告诉人们和编译器,这是通过指定该属性的所有语言环境独特。

So, generally, this means if don't put this attribute, you should always localize this resource, otherwise tell people and compiler that this is unique for all locales by specifying this attribute.

P.S。相信我,当你的项目变大这是非常大的它是非常有帮助的。例如,我目前正在键盘上的项目,这样可以节省大量的时间。

P.S. Trust me, when your project grows large it's extremely big it is very helpful. For example, I'm currently working on keyboard project and it saves lots of time.