2013-03-26 9 views
10

Quando provo ad esportare il pacchetto dell'applicazione firmato per google mao, viene visualizzato questo errore nel file res/value/string.xml. Cosa dovrei fare?Errore pacchetto di applicazioni firmate Android Export

app_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-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. 
You can tell lint (and other tools) which language is the default language in your res/values/ folder by specifying tools:locale="languageCode" for the root <resources> element in your resource file. (The tools prefix refers to the namespace declaration http://schemas.android.com/tools.) 
+0

Hai creato cartelle del formato 'value-af',' value-am', ecc.? – Tushar

+0

possibile duplicato di [Lint: Come ignorare " non è tradotto in " errori?] (Http://stackoverflow.com/questions/11443996/lint-how-to-ignore-key-is-not-translated- in-language-errors) – DroidDev

risposta

13

Prova questo

Vai a Eclipse -> scheda Finestra -> Preferenze -> Android - controllo> errore Lint -> deselezionare l'errore completo controllo eseguito

potrebbe essere il possibile utile

5

Nel file string.xml è sufficiente aggiungere translatable="false" alla stringa. proprio così

<string name="app_name" translatable="false">Example App</string> 
0

Basta rinominare il file string.xml in donottranslate.xml. Questo potrebbe aiutarti.

39

In "Window" > "Preferences" > "Android" > "Lint Error Checking":

Vai a MissingTranslation linea, e impostarlo su Attenzione:

enter image description here

+0

thnx ... ha funzionato !!! –

+0

questo non ha funzionato per me. Sto ottenendo l'errore – Ali

1

Anche se tutte le altre risposte sono corrette, un'altra opzione è quella di aggiungere l'attributo tools:ignore="MissingTranslation" al file 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> 

Preferisco questo perché a) non richiede cha nging ogni valore stringa e b) non è un'impostazione dell'applicazione in modo che possa essere verificata in git. D'altra parte, non sarà di aiuto se gli errori riguarderanno progetti a cui non si ha accesso in scrittura.