AndroidStudio打包出现"xxx" is not translated in "zh" (Chinese) [MissingTranslation]

今天在打包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.

By default this detector allows regions of a language to just provide a subset of the strings and fall back to the standard language strings. You can require all regions to provide a full translation by setting the environment variableANDROID_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.android.com/tools.)

如果一个字符串不需要翻译,可以添加属性translatable="false"在<string>标签里。如:

<string name="name"  translatable="false">Android</string>
或者把你不需要翻译的字符串统一放到一个donottranslate.xml中去。或者给根标签加一个属性tools:ignore="MissingTranslation"来忽略这个问题。如:
<resources  xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值