Last updated

Add translated content

After preparing the structure of your project for localization, add the translated content files to your language subfolders.

Before you begin

Make sure you have the following:

Add translated content files

To add a translated Markdown file or API description file to your project, place the files in their respective language subfolders inside the @l10n folder.

The relative path from the language subfolder to the translated file must be the same as the relative path from the root of the project to the file in the default language. For example, if you originally had a file with path ./index.md, the file translated to Spanish must be located in ./@l10n/es-ES/index.md, as in the following example:

Example file structure for localized content
    your-awesome-project
    ├── @l10n
    ├── es-ES
    ├── images
    ├── index.md
    └── openapi.yaml   
    ├── es-419
    ├── images
    ├── index.md
    └── openapi.yaml
    ├── fr
    ├── images
    ├── index.md
    └── openapi.yaml
    ├── ja
    ├── images
    ├── index.md
    └── openapi.yaml
    ├── zh-Hans
    ├── images
    ├── index.md
    └── openapi.yaml
    └── zh-Hant
        ├── images
        └── openapi.yaml
        ├── index.md
    ├── images
    ├── index.md
    ├── openapi.yaml
    └── redocly.yaml

Localize partial content

You can localize content you include in partials, or reusable content files pulled into multiple files using a partial Markdoc tag.

To localize content in partials:

  1. Add a folder with the same name as your partials folder to each of your language subfolders.
  2. Place the translated content in each of the partials folders.
Example folder structure for localizing partials
    your-awesome-project
    ├── _partials
    ├── @l10n
    ├── es-ES
    ├── _partials
    ├── images
    ├── index.md
    └── openapi.yaml
    │  ... 
    ├── images
    ├── index.md
    ├── openapi.yaml
    └── redocly.yaml

Resources