Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

common_google_play_services_unknown_issue" is not translated in af, am, ar, be, bg

I am trying to export(signed or unsigned) my application. But i was greeted with this error. enter image description here

here is what it says

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

This is the first time i encounter this error. And i cant find any solution in the net. Any idea how to fix this?

like image 967
CodeAndWave Avatar asked Jan 09 '13 02:01

CodeAndWave


3 Answers

I had the same issue. The problem is Lint flagging string translation as a fatal error. In Eclipse you need to go into the preferences (Window -> Preferences -> Android -> Lint Error Checking) and set "Missing Translation" to warning or ignore. This is discussed here

like image 120
user1996723 Avatar answered Nov 16 '22 07:11

user1996723


It is really a problem if "unknown issue" really happens in a language for which there is no translation - this will cause the application to crash with this stacktrace:

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

What I did was to open the google-play-services-lib project, open the default res/values/strings.xml and:

  1. Copy in the English translations - this gets rid of the long compilation warnings.
  2. Add a "translation" for common_google_play_services_unknown_issue:

<string name="common_google_play_services_unknown_issue">"Unknown issue."</string>

This solves the problem with warnings AND does not crash the application at runtime should unexpected circumstances happen.

like image 2
Michal Kottman Avatar answered Nov 16 '22 05:11

Michal Kottman


Or you could add translatable="false" to every string so no errors are produced.For example:

 <string name="hello" translatable="false" >Hello World!</string>
like image 1
Theodoros80 Avatar answered Nov 16 '22 06:11

Theodoros80