Take the 2-minute tour ×

is it possible to specify that the strings in a file within the value-* directories are purposely not translated into other languages? I have a bunch of strings that are common for all the languages and need no translation, so I've created an unlocalized-strings.xml file within values directory.. Running Android Lint to check for problems it keeps saying that some translations are missing.. I do not want to disable this check on the whole project, I'd like to disable it only in some XML files.. is it possible?

"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 

How can defined this region of unlocalized strings?

share|improve this question

7 Answers 7

up vote 36 down vote accepted

I don't know how to ignore all the file, but you can do it string by string using:

<string name="hello" translatable="false">hello</string>

good luck

share|improve this answer
this gives 'non translatable resources should only be defined in the base values /folder. –  advocate Mar 5 '13 at 21:25
And that's correct. If you don't want a string to be translated, you should only define it in the "base values/folder", which means do not enter the string in the translated values/folder. –  Luis Mar 5 '13 at 22:34
unfortunately it's library code :( –  advocate Mar 5 '13 at 22:53

It's the ignore attribute of the tools namespace in your strings file, as follows:

  tools:ignore="MissingTranslation" >

  <!-- your strings here; no need now for the translatable attribute -->

share|improve this answer
<resources tools:ignore="MissingTranslation"> is giving me Error Parsing XML: unbound prefix –  advocate Mar 5 '13 at 21:27
You need to specify the xmlns:tools attribute as well... –  Adil Hussain Mar 6 '13 at 11:07
This works good but I had to go to Project->Clean to remove the errors definitively. –  xonya Dec 2 '13 at 18:32

I think that what you need instead of disabling lint is to mark them with attribute

share|improve this answer

There are 3 ways that I know of :

To apply the modification value by value : Set the attribute translatable="false" on the <string> definition:

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

If you have a lot of resources that should not be translated, you can place them in a file named donottranslate.xml and lint will consider all of them non-translatable resources.

Another way I discovered while browsing Hackers Keyboard project sources:
You can add the prefix donottranslate- to your resource file. As in the previous example, lint will consider all of them non-translatable resources.
In your case, you can replace unlocalized-strings.xml by donottranslate-strings.xml. It seems to work, but I haven't found any documentation for this tip.

See: Android Tools Project Site: Non-translatable Strings

share|improve this answer

And here is a Android Studio solution for disabling this fatal Lint error:

enter image description here

share|improve this answer

If you want to turn of the lint checking on missing translation, you may go

"Project Properties -> Android Lint Preferences -> Select MissingTranslation -> Swtich To Ignore In Severity",

hopes this helps others cause i just encounter this problem :)

share|improve this answer
Is there a way to do it in Android Studio? I couldnt find settings related to lint –  adrian_88 Aug 21 at 10:30

To avoid warnings in Android Studio, open Preferences ==> Inspections, uncheck "Incomplete translations". But it won't affect Gradle build.

share|improve this answer

Your Answer


