"common_google_play_services_unknown_issue"未被翻译成af、am、ar、be、bg。

8

我正在尝试导出(签名或未签名)我的应用程序。但是我遇到了这个错误。 enter image description here

这是它的提示内容。

"common_google_play_services_unknown_issue" 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, nb, nl, pl, pt, pt-rPT, ro, ru, sk, sl, sr, sv, sw, th, tl, tr, uk, vi, zh-rCN, zh-rTW, zu

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.

这是我第一次遇到这个错误。在网络上找不到任何解决方案。有什么想法如何修复它吗?

4个回答

22

我遇到了同样的问题。问题是Lint标记字符串翻译为致命错误。在Eclipse中,您需要进入首选项(Window ->首选项 -> Android -> Lint错误检查),并将“缺少翻译”设置为警告或忽略。这在这里讨论。


只是补充一下... 每次更新Eclipse都需要这样做。几个月前我做过,更新Eclipse后问题又出现了。这个答案再次帮了很多忙! - Cordovaing

2

如果在没有翻译的语言中出现“未知问题”,这真的是一个问题 - 这将导致应用程序崩溃并显示此堆栈跟踪:

android.content.res.Resources$NotFoundException: String resource ID #0x7f0d0039
    at android.content.res.Resources.getText(Resources.java:201)
    at android.content.res.Resources.getString(Resources.java:254)
    at com.google.android.gms.common.GooglePlayServicesUtil.b(Unknown Source)
    at com.google.android.gms.internal.c.a(Unknown Source)
    at com.google.android.gms.internal.c.onCreateView(Unknown Source)
    at com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown Source)
    ...

我所做的是打开 google-play-services-lib 项目,打开默认的 res/values/strings.xml 并进行以下操作:
  1. 复制英语翻译 - 这样可以消除冗长的编译警告。
  2. common_google_play_services_unknown_issue 添加"翻译":

<string name="common_google_play_services_unknown_issue">"未知问题。"</string>

这解决了警告问题,并且在运行时不会崩溃应用程序,即使发生意外情况。


1

或者您可以在每个字符串中添加translatable="false",这样就不会产生错误。例如:

 <string name="hello" translatable="false" >Hello World!</string>

1
这个问题实际上是由于所有被Google Play服务支持但不被你的应用程序支持的语言引起的。你可以删除google_play_services_lib中所有不被你的应用程序支持的语言。
你只需要解决所有剩余的不完整翻译即可。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接