Change app language programmatically in Android

前端 未结 30 3051
面向向阳花
面向向阳花 2020-11-21 04:34

Is it possible to change the language of an app programmatically while still using Android resources?

If not, is it possible to request a resource in an specific lan

30条回答
  •  悲哀的现实
    2020-11-21 05:25

    If someone looking for disable language at compile time, here is the solution:

    android {
        defaultConfig {
            resConfigs "en"
        }
    }
    

    This isn't just for disabling localisation—resConfigs simply tells the build system which resources to keep.

    You can check original answer here

提交回复
热议问题