Overriding string resources from module/library that have translations in Android

2.1k views Asked by At

I'm using a library (maven package) that contains translated strings while my app only has resources in English. According to the following, does this mean that I won't be able to Override the string resources of this library? Is there some way I can exclude the translated strings from the maven package?

This is exact, but it will fail if the string is translated in the library. The translated version in lib override the using-app version (translated or not).

Source

2

There are 2 answers

0
Jiang YD On

yes you can use apktool to extract the translations, change them and pack them back.apktool link

0
Bruce On

Check if the library has a values-en folder. Although you have overridden values/strings.xml, the actual text uses the string in values-en/strings.xml if the language selected is English.

Try to override it in the files below:

values/strings.xml
values-en/strings.xml
values-(any other language)/strings.xml