Is there a way to get the language list from locales_config.xml programmatically?
Asked Answered
R

0

7

I'm very confused about this new language stuff on Android 13.

I have a locales_config.xml file and that works fine but the documentation makes it sound like I can use LocaleListCompat in order to let users with Android 12 or older select the language.

However I haven't found any way to query all the languages listed on locales_config.xml other than parsing the XMl but that just doesn't feel right, plus the names of the languages wouldn't be translated.

So how should I go about giving users a choice of languages from locales_config.xml?

Redraft answered 3/4, 2023 at 20:57 Comment(3)
have you checked this link ? #74114567Exieexigency
Yes but unless I'm reading that incorrectly, they are parsing the xml and there are no localized names for each language. Maybe when they get the locale list it gets translated? but they are still parsing the xml, right?Redraft
Ok, so I think I can use this code to just get the language codes and then I can use the normal Locale library to get the display name, that will hopefully be localized.Redraft

© 2022 - 2024 — McMap. All rights reserved.