“is translated here but not found in default locale” error in strings.xml with translatable=“false”

后端 未结 12 1672
深忆病人
深忆病人 2020-12-08 13:17

Here is my values\\strings.xml (the default file) and everything is self explanatory:

My question(s):

  1. How can it be \"not found in de
相关标签:
12条回答
  • 2020-12-08 13:38

    Press Invalidate Caches / Restart ... to restart android studio. It worked for me. Actually this happened when I had copied files from my other computer and pasted via file explorer.

    0 讨论(0)
  • 2020-12-08 13:41

    Quitting Android Studio and restarting it fixed it for me.

    0 讨论(0)
  • 2020-12-08 13:42

    I had the same error message, just with the weird issue that it was thrown in the default locale itself and all translations. Turns out you should not use dots in your name (e.g. name="bla.blub") because it will be internally converted to "bla_blub" and then it cannot match with "bla.blub", hence the error. I only had to change the dots to underlines in the default locale and then all other errors in other translations (including dots in the name) were gone as well.

    But be aware that other build tools can still create issues, so replace all the dots with underlines instead!

    0 讨论(0)
  • 2020-12-08 13:43

    Just make sure that you have same naming conventions on all strings files including the same capitalization. let's say if you have "sign_in" in strings.xml and "sign_In" in your fr/string.xml, so it will give you error on fr/strings.xml like "is translated here but not found in default locale". So, when you edit to "sign_in". The error will remove.

    0 讨论(0)
  • 2020-12-08 13:43

    Copy and paste didn't work for me.

    I also tried Clean and restart, the previous error was gone but new entered strings still have new errors occur.

    I tried closing the opened strings.xml file and Translations Editor, then restart.

    strings.xml file and Translations Editor

    That works for me.

    0 讨论(0)
  • 2020-12-08 13:47

    I was having this problem for all the strings in my xml file.

    The thing is, your default strings.xml shouldn't have a tools:locale attribute as the other translated files have. If it does, whenever I compile the app in release mode, it treats it as another translated file.

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