Localizing your Builder Data models is a strategic approach to make sure your data resonates with users across different regions. This document covers localizing Data models in Builder, so you can deliver personalized and relevant content experiences to your global audience.
To get the most out of this article, you should already have set up locales and integrated localization with your code. For detailed instructions, visit:
In the Data model:
- Open the Data model.
- Go to the Fields tab.
- Expand a field you'd like to localize.
- Toggle Localize to the on position.
- For the Default value, choose the locale. You might have to expand the Default value section. Available locales are based on what you've previously added. Visit Adding Locales to add more.
In the Data entry:
- Open the Data entry.
- For the field you localized in the Data model, you can use the default, or select one of your other locales.
The video below shows localizing a greeting
field in a Data model and then using one of the locales in a newly created Data content entry:
To apply localization when iterating over Builder data entries, you must set the locale to Dynamic (bound to state). An example workflow follows:
Create the Builder data
- Create your Data model and localize any fields as in the previous section of this document.
- Create Data entries. For example, if you had products you'd like to iterate over, you'd use your Data model to to create an entry for each product.
For detailed instructions, refer to the Data Models documentation which covers what Data models are and how to use and customize them.
In the Visual Editor
- Create a repeatable element, where each repeat will be one of the data entries. For detailed information on creating a repeatable element, read Setting up a repeatable element.
- Bind your data by going to the Data tab > Connect Data > Builder.io. Choose your Data model.
- Select the element that you want to repeat and, still in the Data tab, go to Element data bindings and for Repeat for each, select the results from your model.
- In the Connect Data section of the Data tab (scroll up if you're still in the Element data bindings section from the last step), click on the Query tab. For Locale, choose Dynamic (bound to state). This is an important selection because if you choose one of the locales, only the content for that locale shows.
This document covered the specifics of field-level localization in a Data model. For more information on using field-level, or inline, localization for all models, visit Inline Localization.
This document covered the specifics of field-level localization in a Data model. For more information on using field-level, or inline, localization for all models, visit Inline Localization.