Save & Display data in multiple languages

Hi, I am trying to build a database of movies and want to be able to display the movie titles in German or English depending on the user language.

Can somebody help me out how to do that in bubble?
The information I found on localisation otherwise only referred to the interface localisation, but not on localised data.

Thanks!

I have not had the chance to try this myself, but I asked Chat-GPT for a solution, and it gave this response. Can anybody confirm this actually works?

To display movie titles in either German or English in your Bubble.io app, you can follow a structured approach utilizing the platform’s built-in features for multi-language support and conditional workflows. Here’s a step-by-step guide to achieve this:

1. Set Up Language Preferences for Users

First, you’ll need to add a field to your User data type to store the user’s language preference.

  1. Go to the Data tab in the Bubble editor.
  2. Select the User data type.
  3. Add a new field named “language” with type “text”.

2. Allow Users to Select Their Language

Create a dropdown menu or buttons that allow users to select their preferred language. When a user selects a language, update their language preference in the User data type.

  1. Add a dropdown or button group to your page.
  2. Set options for languages (e.g., English, German).
  3. Use a workflow to update the user’s language field when they make a selection.

3. Store Movie Titles in Multiple Languages

Your database for movies should have separate fields for each language.

  1. In your Movie data type, add two fields: “title_en” (for English titles) and “title_de” (for German titles).

4. Display Titles Based on User Language

Use conditionals to display the correct movie title based on the user’s language preference.

  1. Add a text element to your repeating group or wherever you display movie titles.
  2. Set the dynamic data for this text element to display the title based on the current user’s language setting.

For example:

When current user's language is "en": Current cell's Movie's title_en
When current user's language is "de": Current cell's Movie's title_de

5. Workflow to Update Language Preference

Ensure you have workflows to handle updating the user’s language preference when they interact with your language selection UI.

  1. Create a workflow triggered by the language selection dropdown or buttons.
  2. Use the “Make changes to thing” action to update the current user’s language field.

6. Example Workflow for Language Change

Here’s an example of what the workflow might look like:

  1. When dropdown value changes (or button is clicked):
    • Action: “Make changes to thing”
    • Thing to change: Current User
    • Field to change: language = Dropdown’s value (or button’s associated value)

Additional Tips

  • Utilize Bubble’s “App Text” feature for static text elements to manage translations efficiently.
  • Consider using option sets for translations if you have multiple static texts to manage, which can be easier to update and maintain.

For more detailed guidance, you can refer to discussions on the Bubble Forum about multi-language support and using conditionals to switch text based on user preferences【5†source】【6†source】【7†source】【8†source】【9†source】.

This topic was automatically closed after 70 days. New replies are no longer allowed.