I have some strings of chemical names in a single values/fertilizers.xml
file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="grade_dap">Diammonium phosphate - DAP (18:46:00)</string>
<string name="grade_ssp">Single super phosphate - SSP (00:16:00)</string>
...
</resources>
Now since all these strings in this file shouldn't be translated, can I put a single translatable="false"
attribute to the root <resources>
element, or do I have to put it for all the individual string elements like so:<string name="grade_dap" translatable="false">Single super phosphate - SSP (00:16:00)</string>
If you want to use it to avoid lint warnings, you can simply put MissingTranslation attribute to cover them all.
<?xml version="1.0" encoding="utf-8"?>
<resources
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingTranslation">
<string name="grade_dap">Diammonium phosphate - DAP (18:46:00)</string>
<string name="grade_ssp">Single super phosphate - SSP (00:16:00)</string>
...
</resources>
Referring to the Android Studio Project Site:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With