gpt4 book ai didi

安卓 gradle :how to exclude existing translation/locale from apk?

转载 作者:行者123 更新时间:2023-12-01 03:07:41 25 4
gpt4 key购买 nike

我的安卓应用目前contains 18 translations for 170 different strings范围从 6/170 翻译到 170/170 翻译。

对于不会说英语的应用程序用户来说,如果实际上只有 3% 的字符串被真正翻译,那么说该应用程序支持语言 xx 是没有意义的。

我的问题:是否可以告诉 android-studio 或 gradle 我不希望语​​言 xx 包含在最终的 apk 中而不删除源树中的现有翻译?

我想排除翻译率低于 65% 的语言

也可以看看

  • https://forum.f-droid.org/t/how-complete-should-a-translation-be-before-it-is-included/70
  • https://forum.f-droid.org/t/translating-lots-of-app-summaries/1319/
  • 最佳答案

    我找到了一种明确告诉支持哪些语言环境的方法,因此我必须列出我认为足够完整的语言

    // 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/**'
    }

    关于安卓 gradle :how to exclude existing translation/locale from apk?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55165204/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com