eclipse - Lint: How to ignore "<key> is not translated in <language>" errors?

ID : 20330

viewed : 22

Tags : eclipseandroid-studiolocalizationandroid-resourcesandroid-linteclipse

Top 5 Answer for eclipse - Lint: How to ignore "<key> is not translated in <language>" errors?

vote vote

95

Android Studio:

  • "File" > "Settings" and type "MissingTranslation" into the search box

Eclipse:

  • Windows/Linux: In "Window" > "Preferences" > "Android" > "Lint Error Checking"
  • Mac: "Eclipse" > "Preferences" > "Android" > "Lint Error Checking"

Find the MissingTranslation line, and set it to Warning as seen below:

Missing translations, is not translated in

vote vote

82

You can set the attribute translatable="false" on the definition like this:

<string name="account_setup_imap" translatable="false">IMAP</string> 

For more information: http://tools.android.com/recent/non-translatablestrings

vote vote

71

To ignore this in a gradle build add this to the android section of your build file:

lintOptions {    disable 'MissingTranslation' } 
vote vote

66

This will cause Lint to ignore the missing translation error for ALL strings in the file, yet other string resource files can be verified if needed.

<?xml version="1.0" encoding="utf-8"?> <resources xmlns:tools="http://schemas.android.com/tools"      tools:ignore="MissingTranslation"> 
vote vote

51

If you want to turn off the warnings about the specific strings, you can use the following:

strings.xml

<?xml version="1.0" encoding="utf-8"?> <resources>          <!--suppress MissingTranslation -->     <string name="some_string">ignore my translation</string>     ...  </resources> 

If you want to warn on specific strings instead of an error, you will need to build a custom Lint rule to adjust the severity status for a specific thing.

http://tools.android.com/tips/lint-custom-rules

Top 3 video Explaining eclipse - Lint: How to ignore "<key> is not translated in <language>" errors?

Related QUESTION?