Headless CMS > Advanced
Content Localization
Learn how to create a content model for multiple locales.
- how to create a content model for multiple locales
Webiny offers content localization that allows you to adapt your content to different languages by creating multiple locales. It provides the flexibility to define distinct content schemas for various locales. This means that for each locale, you can create separate content model groups, content models, content entries, etc.
When you create a new locale, you get a clean slate in which you can create new content models, group, and entries. This gives you the flexibility to define variations of content models depending on your locales.
In this tutorial, we will learn how to create a content model for multiple locales. We will do this in 4 steps:
- Step 1: Create and select a new locale.
- Step 2: Create a content model group in the new locale.
- Step 3: Clone a content model into the new locale.
- Step 4: Create a content entry in the new locale.
Prerequisites
To follow this tutorial, you need the Product content model to clone it. If you don’t have the Product content model, please follow the Create Content Model tutorial to create it.
Step 1: Create and Select a New Locale
We will create a new locale for the Italic language.
From the Side Menu, Click Settings > LANGUAGES > Locales.
Click + NEW LOCALE.
✔️ The New locale section opens.
In the Code dropdown, type it.
In the available options in the dropdown, click it-IT.
Click SAVE LOCALE.
Click on the LOCALE dropdown in the header section and select it-IT to switch to the Italian locale.
Step 2: Create a Content Model Group in the New Locale
If you are not familiar with how to create a content model group, please follow the Create Content Model Group tutorial.
Create a content model group with the following attributes in the it-IT locale:
Attribute Value Name Commercio Elettronico Group icon 🛒 Description Gruppo di modelli di e-commerce
Step 3: Clone a Content Model Into the New Locale
There are a couple of ways to create a content model in a locale. You can either create a content model from scratch, or you can clone it from another locale. In this step, we will clone the Product content model from the en-US locale into the it-IT locale. We will update the clone content model’s attributes with the following values:
Attribute | Values |
---|---|
Name | Prodotto |
Group | Commercio Elettronico |
Description | Modello di contenuto del prodotto demo |
Click on the LOCALE dropdown in the header section and select en-US.
From the Side Menu, Click Headless CMS > Models.
Hover on the Product content model.
Click the CLONE CONTENT MODEL icon.
✔️ The Clone Content Model screen opens.
In the Content model locale dropdown, click it-IT.
In the Name textbox, update the text to Prodotto.
In the Content model group dropdown, click Commercio Elettronico.
In the Description textbox, update the text to Modello di contenuto del prodotto demo.
Click + CLONE.
Update the labels of the fields of the Prodotto content model with the following values:
Old Label New Label Name Nome Description Descrizione Price Prezzo
Step 4: Create a Content Entry in the New Locale
If you are not familiar with how to create a content entry, please follow the Create Content Entry tutorial.
Add a content entry in the Prodotto content model with the following attributes:
Attribute Values Nome Allegra K Abito Shift Abito Shift Donna Descrizione Girocollo increspato, manica del braccialetto, polsini elastici, chiusura a bottone posteriore, foro della serratura posteriore, completamente foderato, mini abito Prezzo 55