Lint: How to ignore “ is not translated in ” errors?

后端 未结 13 1963
长情又很酷
长情又很酷 2020-11-27 10:46

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:

相关标签:
13条回答
  • 2020-11-27 11:08

    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)
    0 讨论(0)
  • 2020-11-27 11:09

    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

    0 讨论(0)
  • 2020-11-27 11:15

    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.

    0 讨论(0)
  • 2020-11-27 11:17

    In addition,

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

    enter image description here

    0 讨论(0)
  • 2020-11-27 11:19

    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

    0 讨论(0)
  • 2020-11-27 11:20

    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

    0 讨论(0)
提交回复
热议问题