简体   繁体   中英

Android app bundle not supporting dynamic language change

My app supports multi languages and which can change dynamically within app and that is working fine with APK previously. But When I adapt AAB instead of APK then I am facing this issue. Now my app not change language within app but if I will change language of my device then It will change language of my app as well. Is there any solution for the above issue instead of using

bundle {
        language {
            enableSplit = false
        }
    }

Download additional language resources

With app bundles, devices download only the code and resources they require to run your app. So, for language resources, a user's device downloads only your app's language resources that match the one or more languages currently selected in the device's settings.

If you want your app to have access to additional language resources—for example, to implement an in-app language picker, you can use the Play Core Library to download them on demand.

1. The main way, please see this link:

https://developer.android.com/guide/playcore/feature-delivery/on-demand#lang_resources

2. The latest Android App Bundle updates including the additional languages API

Get a list of installed languages

3. This way will increase the size of the app.

android {
    bundle {
        language {
          
            enableSplit = false
        }
    }
}

4. Use APKs if you want to have an in app language picker.

add this in your app level gradle inside of defaultConfig, with languages you want to include in your application

resConfigs "en", "fr", "ru"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM