android gradle:how to exclude existing translation/locale from apk?
Asked Answered
U

2

7

My android app currently contains 18 translations for 170 different strings ranging from 6/170 translated to 170/170 translated.

For a non-english speaking app users it makes no sense to tell that the app is available in language xx if in fact only 3% of the strings are really translated.

My question: Is it possible to tell android-studio or gradle that i donot want language xx be included in the final apk without deleting the existing translations in the sourcetree?

i want to exclude the languages that are less than 65% translated

See also

Uninhibited answered 14/3, 2019 at 14:34 Comment(1)
Have a look at this question: #41900473 - it may give you some ideasBlowy
U
5

I found a way to explicitly tell which locales to support so i have to list the languages that i consider to be complete enough

// this does not include de=german so german is excluded from apk
android {
    defaultConfig {
        resConfigs "ar","es","fr","hi","in","it","ja","nl","pl","ro","ru","tr","uk","zz","pt-rBR","zh-rCN","zh-rTW"
    }

Unfortunately the answer from How to exclude certain files from Android Studio gradle builds? did not work:

// no error but german resources are not excluded :-(
android {
    sourceSets.main.res.filter.exclude '**/res/values-de/**'
}
Uninhibited answered 15/3, 2019 at 13:25 Comment(1)
complete enough there is not even German in itInefficacy
S
0

I found a way to Games APK explicitly tell which locales to support so i have to list the languages that i consider to be complete enough

Scissile answered 16/4, 2024 at 16:23 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Mccaleb

© 2022 - 2025 — McMap. All rights reserved.