We just pushed an update to how Bubble handles application languages, which makes handling more than one language much easier.
We added a few things:
You can define a field on the user type that contains the language to apply to the user in the Settings Tab -> Languages. The field should be of type ‘text’ and should contain a value that is part of the list in the languages dropdown (english, french, greek, etc.).
You can access the “current language” in the dropdown, as one of the App Data (like Website home, admin email, etc.). You can use this information in the conditional tab to change the text of some elements, for instance
Elements that are localization sensitive will get adjusted automatically (calendar, date input, map, autocomplete for addresses, etc.). A refresh might be needed as some texts are added service-side.
To change the current user’s language, you just need to modify the value of the field. Again, note that you’ll need to refresh the page for most stuff, as the choice of language is done server-side for performance.
You can overwrite the language in the app URL if you want it to be in a given language. The way you’d do it is for instance by doing
The way the Current Language is defined as, by order of priority
a) if a “lang” parameter in the URL is set, use this
b) if the current user has a value in the relevant field, use this
c) Use the app primary language
Be careful on the value you save (or that you put in the URL), it has to match one of the languages in the dropdown. Something like ‘American english’ won’t be applied as it’s not ‘english’, and so we’ll use the next item on the list in 6).
And if some languages are missing, as usual, reach out, we’d love to have more!