Is there a way to get available translations through code?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Gabriel

Hi, I’ve set two translation files in Project Settings > Localization > Translations and I’d like to know if there is a way to get these available translations so that I can feed an OptionButton.
If there is a way to do this through the GUI I’d like to know too.

Thanks in advance.

:bust_in_silhouette: Reply From: haledire

If you haven’t already found out: TranslationServer.get_loaded_locales() will give you all of the locales you have loaded.

Your option button can then use TranslationServer.set_locale(locale[index]) to switch the UI over to the other locales.