在android app bundle上处理app中的动态语言更改 [英] Handle dynamic language change within the app on android app bundle

查看:507
本文介绍了在android app bundle上处理app中的动态语言更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了最新的android包装格式捆绑包,并将我的应用程序发送到Beta渠道,捆绑包减少了应用程序大小的60%左右,真是太棒了,

I have used the latest android packing format bundle and shipped my app to beta channel,bundles reduced ~60% of app size which was really awesome ,

我的应用程序支持英语和阿拉伯语(可以在应用程序中即时切换)

my app has support for english and arabic (can be switched within the app on fly)

现在的问题是:AFAIK基本apk将仅在应用程序下载期间具有用户语言的资源(如果在下载时,如果语言是英语,则只会对string-en.xml进行废弃)

now the problem : AFAIK the base apk will only have resources for the users language during app download (if at time of download,if the language was english.only string-en.xml gets downlaoded)

那么我该如何处理用户在应用内切换语言的情况..

so how do i handle the situation where in user switch the language within the app ..

请让我知道..

推荐答案

AFAIK可以通过使用bundle块来控制您希望应用程序捆绑包支持的配置APK类型.

AFAIK you can do it by using the bundle block to control which types of configuration APKs you want your app bundle to support.

基于文档:

android {

    ...
    bundle {
        language {
            // Specifies that the app bundle should not support
            // configuration APKs for language resources. These
            // resources are instead packaged with each base and
            // dynamic feature APK.
            enableSplit = false
        }
    }
}

这篇关于在android app bundle上处理app中的动态语言更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆