Localization (i18n)

The general philosophy behind GraphCMS is "just enough opinion" to support the widest set of application content without getting in the way with opinionated ideas about pages, tags, categories, etc. I18n (internationalization), however, is a special topic that requires extra thought and execution in the database. We've added support for content locales. Not only that, we've added support for custom content locales as well, no matter what your idea of alternate content entails, we support it.

Adding support for i8n

Multiple content locales, available in all paid plans, are defined in the schema settings.

"Locale settings are in Schema > Configuration"

Here, you define which locales your project will support.

Adding a locale

Type in a name for the locale you want to support, or use the drop-down list to choose one of the common ones. The naming convention we have chosen corresponds to the widest supported standard for language locales.

Be sure to hit save!

"Add Locales"

Translating content

To add translated content, you need to define a model's field as translatable. Choosing any of your your models, edit one of the field definitions and click on advanced. From there, you will see the option to make the field "translatable."

"Add Locale support to fields"

Entering translated content

Now move to a piece of content. In our context we will be using a Robot's standard greeting.

"Add translated content"

For information in how to query the translated content, please see the developer docs related to i18n.