Android Lint が翻訳されていない文字列について警告するのを止めるにはどうすればよいですか? 質問する

Android Lint が翻訳されていない文字列について警告するのを止めるにはどうすればよいですか? 質問する

ディレクトリ内のファイル内の文字列をvalues 意図的に他の言語に翻訳しないように指定することは可能ですか?

すべての言語に共通で翻訳の必要がない文字列がたくさんあります。ディレクトリunlocalized-strings.xml内にファイルを作成しましたvalues。問題がないか確認するために Android Lint を実行すると、翻訳がいくつか欠落していると表示されます。

プロジェクト全体でこのチェックを無効にするのではなく、一部の XML ファイルでのみ無効にしたいのですが、これは可能ですか?

私が遭遇しているエラーは次のとおりです:

"title_widget_updater_service" is not translated in de, en, en-rUS, it

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.

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.

ベストアンサー1

次のように、ファイルに値をtools:ignore持つ属性を追加します。MissingTranslationunlocalized-strings.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>

おすすめ記事