2013-03-26 16 views
10

Khi tôi cố gắng xuất gói ứng dụng đã ký cho google mao, tôi nhận được lỗi này trên tệp res/value/string.xml của mình. Tôi nên làm gì?Lỗi xuất gói ứng dụng đã xuất Android xuất hiện

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

Bạn có tạo thư mục có dạng 'giá trị-af',' giá trị-am', v.v ... không? – Tushar

+0

bản sao có thể có của [Lint: Cách bỏ qua " không được dịch trong " lỗi?] (Http://stackoverflow.com/questions/11443996/lint-how-to-ignore-key-is-not-translated- lỗi ngôn ngữ) – DroidDev

Trả lời

13

Hãy thử điều này

Đến Eclipse -> Window tab -> Preferences -> Android - kiểm tra> lỗi Lint -> bỏ chọn đầy đủ lỗi kiểm tra chạy

có thể nó có thể hữu ích

5

Trong tệp string.xml chỉ cần thêm translatable="false" vào chuỗi. chỉ cần như thế này

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

Chỉ cần đổi tên tệp string.xml thành donottranslate.xml. Có thể điều này sẽ giúp bạn.

39

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

Đến MissingTranslation dòng, và đặt nó vào Cảnh báo:

enter image description here

+0

thnx ... nó hoạt động !!! –

+0

điều này đã không làm việc cho tôi. Tôi stil nhận được lỗi – Ali

1

Mặc dù tất cả các câu trả lời khác là chính xác, tùy chọn khác là để thêm thuộc tính tools:ignore="MissingTranslation" đến xml file:

<?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> 

Tôi thích điều này vì a) nó không yêu cầu cha nging mỗi giá trị chuỗi và b) đó không phải là cài đặt ứng dụng để nó có thể được kiểm tra thành git. Mặt khác, nó sẽ không giúp đỡ nếu các lỗi trong các dự án được tham chiếu mà bạn không có quyền ghi vào.