How to programmatically get the localization value of the android device, i.e. Which language in the system settings, for example, ru, en or ge?

    1 answer 1

    An object of type Locale with all the info about the language can be obtained as follows:

     Locale.getDefault(); //вернёт что-то типа ru_RU 

    The language code in 2 letters can be obtained as follows:

     Locale.getDefault().getLanguage(); //вернёт что-то типа ru