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

I can't compile/debug our Android app, because the localization files are not perfect yet.

My IDE's validation tool Lint create errors saying:

newCardsOrderVals is not translated in ar, bg, ca, cs

Compiling/installing/running with Ant works fine, but I would like to use my IDE to ease debugging.

Is there a way to turn off this particular check, or ideally make it a warning rather than an error?

I understand that before release we will really need to get localisation files right, but for the time being it is not a priority as the screens themselves are being modified very frequently.

The answer is


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


The following worked for me.

  • Click on Windows
  • Click on preferences
  • Select android > Lint Error Checking.
  • Find and select the relevant Lint checking and
  • Set the severity to 'Ignore' (on bottom right)

Insert in the lint.xml file this:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
    ...

    <issue
        id="MissingTranslation"
        severity="ignore" />
</lint>

For more details: Suppressing Lint Warnings.


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


Add following to your gradle file in android section

    lintOptions {
       disable 'MissingTranslation'
    }

add the lines in your /res/values.xml file in resource root tab like this:

<resources
xmlns:tools="http://schemas.android.com/tools" 
    tools:locale="en" tools:ignore="MissingTranslation">

tools:locale set the local language to English, no need of language translation later on that for all resource strings and tools:ignore let Lint to isnore the missing translations of the resource string values.


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

lintOptions {
   disable 'MissingTranslation'
}

Many of them has a given a different working answers, and i too got the same lint errors i make it ignore by doing the following with eclipse.

  1. click on Windows
  2. click on preferences
  3. select android > Lint Error Checking.
  4. click on ignore All > Apply > Ok.

Thats it.


You can also put resources which you do not want to translate to file called donottranslate.xml.

Example and explanation: http://tools.android.com/recent/non-translatablestrings


Another approach is to indicate the languages you intend to support and filter out the rest using the 'resConfigs' option with Gradle.

Check out this other answer for details

This is better, I think, because you don't have to completely ignore legitimate translation mistakes for languages you actually want to support


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

In addition,

Not project dependent properities, Eclipse Preferences.
In Mac, Eclipse > Preferences

enter image description here


Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to android-studio

A failure occurred while executing com.android.build.gradle.internal.tasks "Failed to install the following Android SDK packages as some licences have not been accepted" error Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' Flutter plugin not installed error;. When running flutter doctor ADB.exe is obsolete and has serious performance problems Android design support library for API 28 (P) not working Flutter command not found How to find the path of Flutter SDK

Examples related to localization

What's NSLocalizedString equivalent in Swift? Best practice multi language website Best practice for localization and globalization of strings and labels How to change language of app when user selects language? Lint: How to ignore "<key> is not translated in <language>" errors? Using ResourceManager How do I set the default locale in the JVM? What is the list of supported languages/locales on Android? Android: how to get the current day of the week (Monday, etc...) in the user's language? Get the current language in device

Examples related to android-resources

Failed linking file resources Execution failed for task ':app:processDebugResources' even with latest build tools getResources().getColor() is deprecated getColor(int id) deprecated on Android 6.0 Marshmallow (API 23) Android getResources().getDrawable() deprecated API 22 Android Studio cannot resolve R in imported project? Android XXHDPI resources Android ImageView setImageResource in code format statement in a string resource file Lint: How to ignore "<key> is not translated in <language>" errors?

Examples related to android-lint

What is "android:allowBackup"? Lint: How to ignore "<key> is not translated in <language>" errors? This Handler class should be static or leaks might occur: IncomingHandler Android Lint contentDescription warning