1

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
        }
    }
NickDroid
  • 103
  • 7
  • 1
    I think you're looking for https://stackoverflow.com/questions/52731670/android-app-bundle-with-in-app-locale-change/52733674#52733674 tldr; use the Play Core API to download the languages from Play. – Pierre Apr 24 '20 at 10:32
  • what is the issue with using what you mentioned? I'm asking to know if there are any serious issues because I want to adopt this approach to my app. – Mostafa Onaizan Mar 29 '22 at 23:27

2 Answers2

8

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.

Mori
  • 2,653
  • 18
  • 24
-2

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

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