I want to show a language selector in a Reactive app. But I only want to show the languagues for which actually translations are available.
Is there a way to find out at runtime which multilingual locales are installed? This way no extra manual action is required when a new locale is added.
Hi Rogier,
Unfortunately, it's not possible to know which locales you have a translation for, specially as the translations are at a module level, not at an application level.
What I usually do in these situations is leverage on Multilingual Selector forge component, which allows me to do two things effortlessly: 1) define available locales for an application at runtime in a back-office, effortlessly and 2) use a widget to allow the user to see the available locales and select one among them, with plenty of options (drop-down, list, with flags, abbreviation, etc.).
After that, just need to make sure that it's properly documented what to do when adding another locale to the app (go to the back-office and make sure the new locale is now available in the app).
Hope it helps.
Kind Regards,
João
Thank you João,
Yes, I use this component already. So now I know there is no way to do this automatically.
Best regards,
Rogier