Android: Get missing translations for strings-resources

前端 未结 16 1473
無奈伤痛
無奈伤痛 2020-12-02 22:43

In Android, you can specify the texts in the default locale in res/values/strings.xml. Additional translations can be added for new languages in res/value

16条回答
  •  执念已碎
    2020-12-02 23:30

    Steps to get all missing translations are :

    1. enable lint error for missing translation in app level build.gradle

      lintOptions {
         abortOnError false
         enable 'MissingTranslation'
      }
      
    2. add languages to compare inside default config of level.gradle (here english and hindi)

      resConfigs "en", "hi"
      
    3. right click on default strings.xml. Then Analyze -> Inspect Code

    1. now check inspection result. Android -> Lint -> Correctness -> Messages > Incomplete Translation

    1. All selected strings are missing translations

提交回复
热议问题