Reputation: 3732
So I added GDPR dialog library in my Android app, which is translated in 10 languages. And my app currently has translations in 7 languages.
Now, the problem is, it shows error for all the strings in my app like below:
The error says,
"load_next" is not translated in "cs"(Czech), etc (names of languages which library has but my app doesn't)
My app is in 7 different languages, when I added GDPR library by using implementation 'com.github.MFlisar:GDPRDialog:LATEST-VERSION'
, this error isn't shown, but as I wanted to make some changes of my own, I downloaded the library and added it as a java module in my app, and then this error started showing up.
App compiles and runs without error (if I've added the translations for all the languages that I've used), but it's a huge inconvenience as I can't just glance at string.xml
and find out if I missed any translations(as it shows this error for all the text).
So is there any way I can correct this thing without having to:
Maybe something with which I can suppress this warning only for selected languages?
Upvotes: 3
Views: 114
Reputation: 364085
You can use in the build.gradle
resConfigs "en", "de", "it", "fr"
You can check the official doc:
Specifies a list of alternative resources to keep.
For example, if you are using a library that includes language resources (such as AppCompat or Google Play Services), then your APK includes all translated language strings for the messages in those libraries whether the rest of your app is translated to the same languages or not. If you'd like to keep only the languages that your app officially supports, you can specify those languages using the resConfigs property, as shown in the sample below. Any resources for languages not specified are removed.
android {
defaultConfig {
...
// Keeps language resources for only the locales specified below.
resConfigs "en", "fr"
}
}
Upvotes: 4