是否可以指定文件中的字符串values
目录故意不翻译成其他语言?
我有一堆所有语言通用的字符串,不需要翻译。我创建了一个unlocalized-strings.xml
文件内的values
目录。当我运行 Android Lint 检查问题时,它一直说缺少一些翻译。
我不想对整个项目禁用此检查。我只想在某些 XML 文件中禁用它。这可能吗?
这是我遇到的错误:
"title_widget_updater_service" is not translated in de, en, en-rUS, it
Issue: Checks for incomplete translations where not all strings are translated
Id: MissingTranslation
If an application has more than one locale, then all the strings declared in one language
should also be translated in all other languages.
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 variable
ANDROID_LINT_COMPLETE_REGIONS.
Add the tools:ignore
属性带有一个MissingTranslation
你的价值unlocalized-strings.xml
文件,如下:
<?xml version="1.0" encoding="utf-8"?>
<resources
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingTranslation" >
<!-- your strings here; no need now for the translatable attribute -->
</resources>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)