{"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"translate","__idx":0},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translate"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translate"]}," command helps you to manage multiple translations in your Redocly project (Reef, Revel, or Realm only)."," ","It creates or updates ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translations.yaml"]}," files, populating them with \"translation keys\" that map to elements in your documentation's UI."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This command serves two purposes:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On first run, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translate"]}," creates (or populates) a file with built-in translation keys for common UI elements."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On future runs, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translate"]}," adds custom, user-defined translation keys from your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redocly.yaml"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sidebars.yaml"]}," files."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"usage","__idx":1},"children":["Usage"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly translate <locale>\nredocly translate all\nredocly translate --help\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"options","__idx":2},"children":["Options"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["locale"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["REQUIRED"]}," Name of a locale folder, inside your project's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["l10n"]}," directory, to generate translations for. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["all"]}," for all locales."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--lint-config"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Severity level for config file linting. Possible values: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["warn"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["off"]},". Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["warn"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--project-dir, -d"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Path to the project directory. The default value is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["."]}," (current directory)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--help"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Show help."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":3},"children":["Examples"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following sections show some common use cases for the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translate"]}," command."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"populate-translation-keys-for-specific-locale","__idx":4},"children":["Populate translation keys for specific locale"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following command generates or updates translations for the Dutch locale:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"Translate specific locale","header":{"title":"Translate specific locale","controls":{"copy":{}}},"source":"redocly translate nl-NL\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The translations are placed in the file ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@l10n/nl-NL/translations.yaml"]},"."," ","If the file (or folder) doesn't exist, they're created and populated with translation keys."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"populate-translation-keys-for-all-locales","__idx":5},"children":["Populate translation keys for all locales"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["all"]}," keyword to generate translations for all the locale folders inside the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@l10n"]}," directory:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"Translate all locales","header":{"title":"Translate all locales","controls":{"copy":{}}},"source":"redocly translate all\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This command updates the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translation.yaml"]}," files for every locale with a folder in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@l10n"]},", as shown in the following example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"treeview","data-title":"Project with multiple locales","header":{"title":"Project with multiple locales","controls":{"copy":{}}},"source":"your-awesome-project\n├── @l10n/\n│   ├── es-ES/\n│   │   ├── transcriptions.yaml\n│   │   └── ...\n│   ├── fr/\n│   │   ├── transcriptions.yaml\n│   │   └── ...\n│   └── nl-NL/\n│       ├── transcriptions.yaml\n│       └── ...\n├── index.md\n├── sidebars.md\n├── redocly.yaml\n└── ...\n","lang":"treeview"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"populate-translation-keys-in-a-specific-project","__idx":6},"children":["Populate translation keys in a specific project"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--project-dir"]}," option to run the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translate"]}," command from a parent folder and populate translation keys inside a specific project:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly translate all --project-dir='museum-docs'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following project structure represents the output of running this command from the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["projects"]}," folder:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"treeview","data-title":"Multiple projects in same folder","header":{"title":"Multiple projects in same folder","controls":{"copy":{}}},"source":"projects/\n├── storage-docs/\n├── authentication-docs/\n└── museum-docs/\n    ├── @l10n/\n    │   ├── es-ES/\n    │   │   ├── transcriptions.yaml\n    │   │   └── ...\n    │   ├── fr/\n    │   │   ├── transcriptions.yaml\n    │   │   └── ...\n    │   └── nl-NL/\n    │       ├── transcriptions.yaml\n    │       └── ...\n    ├── index.md\n    ├── sidebars.md\n    ├── redocly.yaml\n    └── ...\n","lang":"treeview"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--project-dir"]}," option is designed to help manage multiple projects by reducing the need for traversal."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"tips-for-using-translate","__idx":7},"children":["Tips for using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translate"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The command is additive; it doesn't overwrite existing translation keys."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Custom translation keys used in React components ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["must be manually added"]}," to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["translation.yaml"]}," file."," ","They are not populated by the command."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After using the command, review a translation file to ensure new translation keys are present."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Automating this command can help keep translation keys updated across multiple locales."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"resources","__idx":8},"children":["Resources"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See how to ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"https://redocly.com/docs/realm/author/how-to/config-l10n"},"children":["configure localization"]}," in your Redocly project."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure which languages users can select using the ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"https://redocly.com/docs/realm/config/l10n"},"children":["localization option"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["l10n"]},") in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redocly.yaml"]},"."]}]}]}]},"frontmatter":{},"tagList":[],"title":"translate","lastModified":"2026-10-07T06:18:11.000Z"}