In the previous post, the application we created identifies the locale before application is loaded. But in some situation where we need to change the language of the application at runtime or on the go according to the user’s need. You might have seen some application which has dialog or menu which list the languages supported by the application.
On selecting the language from the list, entire application will be applied with the locale/language selected which happens at runtime.
Follow the previous post example, where we are going to add spinner control to display the list of languages and add logic in activity class to handle the locale changes.
Either you can proceed with the below listings, or you can directly download code.
To build multilingual Android apps we need to put bit effort in translating the content of the App and putting them in the appropriate folders.
Once we provide the translation, Android OS will choose the resources that match user’s locale (English/Hindi/Tamil/Korean). If the application is available in several languages, Android will select the language that the device uses.
In this tutorial, we’ll cover: