As a Bubble application sends and displays messages in English by default, you may want to customize the language that your app is built in. Bubble supports modifying the app language, customizing messages, and even multi-language apps. You can configure this in the Languages section of the Settings Tab.
The main language is the language that is used by Bubble to run your app when no language setting is set. This language will be used to define the messages that your application can send and show to users and change how location-sensitive elements behave. For instance, it will impact how dates are formatted in the Date Input element and the Calendar element or the map element's captions.
Bubble represents languages with their code. The code is what is found between parentheses in the languages list. For instance, American English is 'en_us', French is 'fr_fr', Simplified Chinese is 'zh_cn'.
If a language or a regional version is missing, please get in touch. We are always happy to add more languages.
If you plan on supporting more than one language for your app, you will probably want users to be able to set the language they want to use the app in, and will want to save this information. Bubble lets you define a field on the User type to save this information. It should be a field of type 'text'. It is your responsibility in your workflows to save the value of the language the user wants to use in the field. The value that should be saved is the language code defined above.
The application language can also be set in the URL, but using the lang querystring parameter. This means adding
lang=code to the URL, where
code is the standardized language code, i.e. the one found in Settings > Language (most, but not all, of these codes have the format of two characters, underscore, two characters). For instance, using Russian in your app would be done by hitting this URL
The way the Current Language is defined as, by order of priority
- Use the "lang" parameter in the URL if it is set
- Use the current user's language if the field's value exists
- Use the application primary language
- Use English
The Language section of the Settings Tab is also where you can customize the content of the different messages your app may show to users. For instance, if you use a 'Sign the user up' action with password confirmation and if the passwords don't meet, you may want to change the message "The two passwords do not match!".
To do this, pick the language you want to modify and then you can edit the application messages in the list.
If you need to customize the content of some elements in your pages depending on the language, Bubble lets you define some App Texts. Instead of using conditions and list all texts at each elements level, defining App Texts is a more scalable and efficient way to define texts that vary depending on the current language.
To create an App Text, pick 'App Text' in the Expression Composer.
When you pick this data source, you can either create a new Text, or use one of the already defined ones. Editing the content of each App Text is similar to editing native application messages. You pick the language you want to edit and then edit the messages in the list. In run mode, App Texts will return the value that you defined in the current language.