Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 deletions docusaurus/docs/cms/features/internationalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ tags:
- features
---

import StrapiAiCredits from '/docs/snippets/strapi-ai-credits.md'

# Internationalization (i18n)

<Tldr>
Expand Down Expand Up @@ -83,6 +85,21 @@ It is not possible to create custom locales. Locales can only be created based o
}}
/>

#### Enabling AI-powered internationalization
<GrowthBadge />

AI-Powered Internationalization enables automatic translations for all the locales in a project when the content in the default locale is updated. This enables content editors to have their content translated into multiple languages within a few seconds.

AI-powered Internationalization is disabled by default. To enable it, go to <Icon name="gear-six" /> *Settings > Global Settings > Internationalization* and set <Icon name="sparkle" /> _AI Translations_ to _Enabled_.

<ThemedImage
alt="Internationalization settings"
sources={{
light: '/img/assets/settings/i18n-with-ai.png',
dark: '/img/assets/settings/i18n-with-ai_DARK.png',
}}
/>

### Code-based configuration

A `STRAPI_PLUGIN_I18N_INIT_LOCALE_CODE` [environment variable](/cms/configurations/environment#strapi) can be configured to set the default locale for your environment. The value used for this variable should be an ISO country code from <ExternalLink to="https://github.com/strapi/strapi/blob/main/packages/plugins/i18n/server/src/constants/iso-locales.json" text="the 500+ pre-created list of locales"/>.
Expand All @@ -105,10 +122,6 @@ To translate content in another locale:
2. Choose the locale in which you want to translate your content.
3. Translate your content by filling up your content-type's fields.

:::tip
Click on the <Icon name="download-simple" /> *Fill in from another locale* button, in the top right corner, for all non relational fields to be filled up with the values of another chosen locale. It can be useful if you do not remember what was the exact content in another locale.
:::

<ThemedImage
alt="Managing locales with i18n"
sources={{
Expand All @@ -117,6 +130,33 @@ Click on the <Icon name="download-simple" /> *Fill in from another locale* butto
}}
/>

:::tip
Click on the <Icon name="globe-hemisphere-west" /> *Fill in from another locale* button, in the top right corner, for all non relational fields to be filled up with the values of another chosen locale. It can be useful if you do not remember what was the exact content in another locale. This button is not visible if you've enabled [AI-powered internationalization](#ai-powered-internationalization) since translations are automatically handled by Strapi AI.
:::

### AI-powered internationalization <NewBadge /> {#ai-powered-internationalization}
<GrowthBadge />

[When enabled](#enabling-ai-powered-internationalization), AI-powered internationalization enables automatic translations for all the locales in a project when the source content is updated. This enables content editors to have their content translated into multiple languages within a few seconds. The idea behind the feature is to ensure users only manually fill in content in the default locale, and Strapi AI translates it for all other existing locales.

Once enabled, whenever you edit a content-type in the default locale and click **Save**, all other locales for the content-type should be translated automatically, which will be confirmed by an _All locales have been translated_ notification. Using this feature consumes Strapi AI credits.

<ThemedImage
alt="Managing locales with AI-powered i18n"
sources={{
light: '/img/assets/content-manager/locale-i18n-with-ai.png',
dark: '/img/assets/content-manager/locale-i18n-with-ai_DARK.png',
}}
/>

:::caution
AI-powered internationalization only works one way, keeping the default locale content as the unique source of truth. Consequently, once the feature is enabled:
- Editing and saving content for any locale othen than the default one will not trigger automatic translations.
- When editing the content for the default locale, the manual modifications made to other locales will be overwritten.
:::

<StrapiAiCredits />

### Usage with APIs

Localized content can be requested, created, updated, and deleted for a given locale through the various front-end APIs accessible from [Strapi's Content API](/cms/api/content-api):
Expand Down
3 changes: 3 additions & 0 deletions docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ const sidebars = {
type: 'doc',
label: 'Internationalization (i18n)',
id: 'cms/features/internationalization',
customProps: {
updated: true,
},
},
{
type: 'doc',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.