javaとかandroidでの開発やったことないのに、何故かバグ取りをすることになりました・
調べたりして試行錯誤してなんとかバグの原因は判明し修正することはできました。
どこか想定しないコードを触ってしまい、ビルド時に以下の様なエラーが発生しました。
調べてみると、他言語対応して下さい的なエラーみたいです。。
なんとか解決したので、ここにメモしておきます。
もうandroidでの開発しないと思いますが。
エラーメッセージ
1 2 3 4 5 6 7 8 9 10 11 12 13 | "app_id" is not translated in "af" (Afrikaans), "am" (Amharic), "ar" (Arabic), "bg" (Bulgarian), "bn-rBD" (Bengali: Bangladesh), "ca" (Catalan), "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "en-rGB" (English: United Kingdom), "en-rIN" (English: India), "es" (Spanish), "es-rUS" (Spanish: United States), "et-rEE" (Estonian: Estonia), "eu-rES" (Basque: Spain), "fa" (Persian), "fi" (Finnish), "fr" (French), "fr-rCA" (French: Canada), "gl-rES" (Galician: Spain), "hi" (Hindi), "hr" (Croatian), "hu" (Hungarian), "hy-rAM" (Armenian: Armenia), "in" (Indonesian), "is-rIS" (Icelandic: Iceland), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ka-rGE" (Georgian: Georgia), "kk-rKZ" (Kazakh: Kazakhstan), "km-rKH" (Khmer: Cambodia), "kn-rIN" (Kannada: India), "ko" (Korean), "ky-rKG" (Kyrgyz: Kyrgyzstan), "lo-rLA" (Lao: Lao People's Democratic Republic), "lt" (Lithuanian), "lv" (Latvian), "mk-rMK" (Macedonian: Macedonia, the former Yugoslav Republic of), "ml-rIN" (Malayalam: India), "mn-rMN" (Mongolian: Mongolia), "mr-rIN" (Marathi: India), "ms-rMY" (Malay: Malaysia), "my-rMM" (Burmese: Myanmar), "nb" (Norwegian Bokmal), "ne-rNP" (Nepali: Nepal), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "pt-rBR" (Portuguese: Brazil), "pt-rPT" (Portuguese: Portugal), "ro" (Romanian), "ru" (Russian), "si-rLK" (Sinhala: Sri Lanka), "sk" (Slovak), "sl" (Slovene), "sr" (Serbian), "sv" (Swedish), "sw" (Swahili), "ta-rIN" (Tamil: India), "te-rIN" (Telugu: India), "th" (Thai), "tl" (Tagalog), "tr" (Turkish), "uk" (Ukrainian), "ur-rPK" (Urdu: Pakistan), "uz-rUZ" (Uzbek: Uzbekistan), "vi" (Vietnamese), "zh-rCN" (Chinese: China), "zh-rHK" (Chinese: Hong Kong), "zh-rTW" (Chinese: Taiwan, Province of China), "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.)[] |
解決方法
- ウインドウ→設定→Android→Lintエラー検査を開きます。
- フィルター入力欄に「MissingTranslation」と入力します。
- 下の画面にMissingTranslatioの設定が表示されるので、 重大度を「Fatal」から「Warning」へ変更し適用ボタンをクリックします。
- 「OK」ボタンをクリックすると、「not translated」とかのエラーは表示されなくなっています。
それでもエラーが消えない場合は
解決案1
エラーが発生しているstringタグ1つずつに「tools:ignore=”MissingTranslation”」を付ける。
<string name=”app_name” tools:ignore=”MissingTranslation”>hogemiku</string>
解決案2
各ファイルのresourcesに「tools:ignore=”MissingTranslation”」を付ける。
<resources xmlns:tools=”http://schemas.android.com/tools” tools:ignore=”MissingTranslation”>