Locales
This article provides an introduction to Prismic languages and locales.
This document explains how to add locales to your Prismic repository. Want to learn how to copy and translate content? See Navigate Languages and Copy Content.
Prismic supports localization, allowing you to set localized versions of each document.
A locale represents a language and a region. Each locale has a five-character locale code, formatted la-re
, where la
stands for a language and re
stands for a region.
You can use locales for:
- translating content (
en-ca
andfr-ca
for English and French Canadian content) - localizing content (
en-gb
anden-us
for British and American content) - both translating and localizing (
en-us
andes-mx
for English US and Spanish Mexican content). If you don't find your desired locale, you can create your own custom locales, as described below.
Here, you will learn how to set the master locale and add more locales to your Prismic repository.
The master locale is the default locale of your repository.
Once you create a repository in the Prismic dashboard, It will ask you to set the master locale for your content. It will be the base for all the translations into other languages. Later, you can add translations and locales for multilingual purposes.
Can I change the master locale?
To change the master locale, send a request to the activations in the support portal.
For example, if "en-gb" is your master locale, it will be available in the lang
property of the API response:
"lang": "en-gb",
To add a locale, perform the following steps:
- In your repository, navigate to Settings > Translations & locales. You will find the master locale along with the option to Select an existing locale from the list or create your own.
- Click on the dropdown icon. It will show a list of available languages. Select the required locale from the list. The selected locale code will appear.
The new locale will be available in the language dropdown of the document list and inside each document.
Can I delete a locale?
Yes, you can delete a locale in Settings. But first, you will need to delete all documents from that locale. Learn more about how to archive and delete a document.
If you translate a document to the French locale, for example, fr-fr
will be available in the "alternate_languages"
property of the API response.
"alternate_languages" : [
{
"id": "XTb4mBAAACQAOfrg",
"type": "homepage",
"lang": "fr-fr
}
To create a locale that isn't available in the list of options, follow these steps:
- Go to your repository and navigate to Settings > Translations & locales; click on Select an existing locale from the list or create your own. Then, Scroll down to the bottom of the existing locales and click on + Create a custom locale. It will open an overlay.
- Type a language in the Language and Region. This will automatically generate a two-character locale code.
Was this article helpful?
Can't find what you're looking for? Spot an error in the documentation? Get in touch with us on our Community Forum or using the feedback form above.