今天在打包apk时出现了"xxx" is not translated in "zh" (Chinese) [MissingTranslation]的错误。
解决方法:
看它的描述可以直接解决问题:
Incomplete translation
If an application has more than one locale, then all the strings declared in one language should also be translated in all other languages. If the string should not be translated, you can add the attributetranslatable="false"
on the <string>
element, or you can define al l your non-translatable strings in a resource file called donottranslate.xml
. Or, you can ignore the issue with atools:ignore="MissingTranslation"
attribute.
ANDROID_LINT_COMPLETE_REGIONS
. You can tell lint (and other tools) which language is the default language in yourres/values/
folder by specifying tools:locale="languageCode"
for the root<resources>
element in your resource file. (The tools
prefix refers to the namespace declarationhttp://schemas..com/tools
.) 如果一个字符串不需要翻译,可以添加属性translatable="false"
在<string>标签里。如:
Android 或者把你不需要翻译的字符串统一放到一个donottranslate.xml中去。或者给根标签加一个属性tools:ignore="MissingTranslation"来忽略这个问题。如:
参考:http://blog.csdn.net/gentlemanyc/article/details/50578466