"Description Resource Path Location Type
"your_string_name" is not translated in af, am, ar, be, bg, ca, cs, da, de, el, en-rGB, es, es-rUS, et, fa, fi, fr, hi, hr, hu, in, it, iw, ja, ko, lt, lv, ms, nb, nl, pl, pt, pt-rPT, ro, ru, sk, sl, sr, sv, sw, th, tl, tr, uk, vi, zh-rTW, zu strings.xml /projectname/res/values line 44 Android Lint Problem

如果你遇到类似上面的错误,那你要么想办法编制提示到的所有语言版本,一个不漏地将所有字符串资源翻译一遍,要么就看看调整项目属性项怎么解决。

其实当这个错误发生时一般都会出现这个警告对话框,仔细看这个对话框的信息,不难发现,我们要检查preference页,可我也是初学,不太熟,找了好一会儿才找到。

字符串资源多国语言版本的出错问题_第1张图片

你右击左侧栏项目名称,在弹出菜单中选最后一项"Properties"打开。在下面页面中选择 “Android Lint Preference”,然后将 “MissingTranslation” 从 “fatal” 改为 “warning"或“warning"以下的选项。

字符串资源多国语言版本的出错问题_第2张图片

当然,在发布版本之前最好还是用胶严厉的选项检查一下比较好。

另外,在“Lint warnings” 信息框里,会有更多类似下面的提示,可以让你更好的控制多国语言问题。


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.

If the string should not be translated, you can add the attribute translatable="false" on the <string> element, or you can define all your non-translatable strings in a resource file called donottranslate.xml. Or, you can ignore the issue with a tools: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 variable ANDROID_LINT_COMPLETE_REGIONS.

更多相关文章

  1. Android中的对话框的使用技巧
  2. Android中Gradle配置打包运行不同版本
  3. Android 第七天重置版_样式主题国际化动画对话框
  4. Android AlertDialog 对话框 ProgressDialog
  5. Android各版本新增功能一览
  6. Android各版本特性比较

随机推荐

  1. Asp.NET页面事件加载的顺序是什么样的
  2. 关于.NET后台定时服务框架的简单介绍
  3. 分享基于字符串加密的MD5算法实例代码
  4. ASP.NET中关于Config文件如何读写的实例
  5. c#中关于多线程创建对象的示例分享
  6. .net使用Cache框架的实例介绍
  7. .NET中关于接口和类之间的区别介绍
  8. C#中如何监控类属性更改的代码案例分享
  9. HttpPostedFileBase文件上传实例详解
  10. 命名管道跨进程通讯