2013-01-09 65 views
8

我嘗試導出翻譯(符號或無符號)我的申請。但我是用這個錯誤的歡迎。 enter image description herecommon_google_play_services_unknown_issue」不是AF,AM,AR,是BG

這裏是說話算數

"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. 

這是我第一次遇到這樣的錯誤,而我不能找到在網絡的任何解決方案。任何想法如何解決這一問題?

回答

22

我有同樣的問題,但問題是林特萎靡不振串翻譯爲致命錯誤。在Eclipse中,您需要進入首選項(窗口 - >首選項 - > Android - > Lint錯誤檢查),並將「Missing Translation」設置爲警告或忽略。這是討論here

+0

只是補充......每次更新Eclipse時都需要這樣做。我幾個月前做過,更新Eclise,問題再次出現。這個答案幫助了很多(再次)! – 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">"Unknown issue."</string>

這解決了問題,警告和不崩潰在運行時應該意想不到的情況下發生的應用程序。

1

或者你可以添加translatable="false"到每一個字符串,沒有錯誤produced.For例如:

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

這個問題實際上是由是由谷歌Play業務的支持,但其所有的語言中引起不支持你自己的應用。您可以從google_play_services_lib中刪除所有不受您的應用支持的語言。

您只需要解析所有剩餘的不完整翻譯。