我的Android应用程序目前contains 18 translations for 170 different strings从6/170翻译为170/170翻译。
对于非英语应用程序的用户来说,如果实际上只有3%的字符串是真正翻译的,那么告诉应用程序在语言xx中是否可用是没有意义的。
我的问题:是否有可能告诉android-studio或gradle我不希望语言xx被包含在最终的apk中而不删除sourcetree中的现有翻译?
我想排除低于65%翻译的语言
也可以看看
我找到了一种明确告诉哪些语言环境支持的方法,所以我必须列出我认为足够完整的语言
// 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"
}
不幸的是How to exclude certain files from Android Studio gradle builds?的答案不起作用:
// no error but german resources are not excluded :-(
android {
sourceSets.main.res.filter.exclude '**/res/values-de/**'
}