From 0ab7648e42655e7ce26b96272fd3351c3f2eb6ae Mon Sep 17 00:00:00 2001 From: martyanov-av Date: Tue, 1 Sep 2026 12:29:18 +0300 Subject: [PATCH] docs: restructure localization section, document XLIFF extract/compose workflow --- en/toc.yaml | 4 + en/tools/docs/translate-ai.md | 6 +- en/tools/docs/translate-xliff.md | 105 ++++++++++++ en/tools/docs/translate-yandex.md | 49 ++++++ en/tools/docs/translate.md | 265 ++++++++++-------------------- ru/toc.yaml | 4 + ru/tools/docs/translate-ai.md | 6 +- ru/tools/docs/translate-xliff.md | 107 ++++++++++++ ru/tools/docs/translate-yandex.md | 51 ++++++ ru/tools/docs/translate.md | 261 ++++++++++------------------- 10 files changed, 504 insertions(+), 354 deletions(-) create mode 100644 en/tools/docs/translate-xliff.md create mode 100644 en/tools/docs/translate-yandex.md create mode 100644 ru/tools/docs/translate-xliff.md create mode 100644 ru/tools/docs/translate-yandex.md diff --git a/en/toc.yaml b/en/toc.yaml index da7f8248..f662d106 100644 --- a/en/toc.yaml +++ b/en/toc.yaml @@ -168,8 +168,12 @@ items: - name: Localization href: tools/docs/translate.md items: + - name: Machine translation + href: tools/docs/translate-yandex.md - name: AI translation href: tools/docs/translate-ai.md + - name: XLIFF exchange with CAT tools + href: tools/docs/translate-xliff.md - name: Deploying to S3 href: tools/docs/publish-s3.md - name: Portable CLI build diff --git a/en/tools/docs/translate-ai.md b/en/tools/docs/translate-ai.md index 43b248fa..3c3fb5ec 100644 --- a/en/tools/docs/translate-ai.md +++ b/en/tools/docs/translate-ai.md @@ -5,7 +5,7 @@ keywords: ['translate', 'ai', 'llm', 'yandexgpt', 'openai', 'openrouter', 'anthr The command `{{PROGRAM}} translate` can translate documentation using large language models (LLMs). Supported providers are `yandexgpt`, `openai`, `openrouter`, and `anthropic`. -The pipeline is the same as for [other translation providers](translate.md): text is extracted from the markup, translated, and assembled back. Markdown markup, HTML tags, code, and Liquid constructs do not reach the model — only text segments are translated. +The pipeline is the same as for [other translation methods](translate.md#pipeline): text is extracted from the markup, translated, and assembled back. Markdown markup, HTML tags, code, and Liquid constructs do not reach the model — only text segments are translated. Here, a provider describes an API protocol, not a specific vendor: any compatible installation (self-hosted model, internal gateway) can be connected with the same provider by [replacing the API address](#custom-api). @@ -90,11 +90,11 @@ The request path for each provider is fixed: if the gateway uses a non-standard ## Options reference {#options} -Common command options (`--source`, `--target`, `--files`, `--include`, `--exclude`, `--include-vcs-diff`, `--dry-run`, and others) are described on the [Localization](translate.md) page. The `--target` option can be passed multiple times - translation will be performed into each language. Below are the AI provider options. +Common command options (`--source`, `--target`, `--files`, `--include`, `--exclude`, `--include-vcs-diff`, `--dry-run`, and others) are described on the [Localization](translate.md#options) page. The `--target` option can be passed multiple times - translation will be performed into each language. Below are the AI provider options. #| || **Option** | **Default** | **Description** || -|| `--provider` | `yandex` | Translation provider. For AI translation: `yandexgpt`, `openai`, `openrouter`, or `anthropic`. The default value `yandex` is machine translation via [Yandex Translate](translate.md#auto), not an LLM || +|| `--provider` | `yandex` | Translation provider. For AI translation: `yandexgpt`, `openai`, `openrouter`, or `anthropic`. The default value `yandex` is machine translation via [Yandex Translate](translate-yandex.md), not an LLM || || `--auth` | from the environment variable | Token or path to a file with the token. Cannot be placed in the configuration file || || `--model` | depends on the provider | Model identifier || || `--fallback-model` | - | Fallback model in the same format as `--model`. See [Fallback model](#fallback) || diff --git a/en/tools/docs/translate-xliff.md b/en/tools/docs/translate-xliff.md new file mode 100644 index 00000000..b422187c --- /dev/null +++ b/en/tools/docs/translate-xliff.md @@ -0,0 +1,105 @@ +--- +keywords: ['translate', 'xliff', 'cat', 'extract', 'compose', 'trados', 'smartcat', 'crowdin'] +--- +# XLIFF exchange with CAT tools + +When translation is done by people - in-house translators or an agency - they usually work in a Computer Assisted Translation (CAT) tool: Trados, Phrase, Smartcat, Crowdin, and the like. The standard exchange format for such tools is [XLIFF](https://en.wikipedia.org/wiki/XLIFF). + +The `extract` and `compose` subcommands of the `{{PROGRAM}} translate` command implement the full cycle of such translation: + +1. `extract` exports the translatable project text into `*.xliff` files. +2. The files are translated in a CAT tool. +3. `compose` assembles the translated `*.xliff` back into documentation files. + +## How it works {#how-it-works} + +`extract` splits each documentation file into two parts: + +* `.xliff` - translatable segments: sentences, headings, table cells; +* `.skl` - the skeleton: the source file with markers in place of the segments. + +Markup, code, and Liquid constructs stay in the skeleton and never reach the CAT tool - see [How translation works](translate.md#pipeline) for details. + +Both files are saved under the target language path. For example, when translating from `ru` into `en`, the file `ru/guide/index.md` produces `en/guide/index.md.xliff` and `en/guide/index.md.skl`. + +`compose` performs the reverse operation: it finds `.xliff` + `.skl` pairs in a directory and assembles a translated file from each - `en/guide/index.md`. Files without a pair are skipped with a warning. + +## Full cycle example {#example} + +```bash +# Export segments: en/**/*.xliff and en/**/*.skl appear in ./xliff +{{PROGRAM}} translate extract -i ./docs -o ./xliff --source ru --target en + +# ...translate *.xliff in a CAT tool... + +# Assemble translated files into ./docs/en +{{PROGRAM}} translate compose -i ./xliff -o ./docs +``` + +Only the `*.xliff` files are handed over to the CAT tool, but during assembly the translated `*.xliff` must sit next to their `*.skl` - don't delete the skeletons between steps. + +After `compose`, the translated version is built with a regular `{{PROGRAM}} build`. + +## XLIFF format {#format} + +`extract` produces XLIFF version 1.2. Each segment is a `` element with the source text in ``. The translation must go into the `` element - CAT tools add it themselves: + +```xml + + + +
+ + + +
+ + + Document title + + +
+
+``` + +Inline markup inside a segment - emphasis, links, code - is encoded with the auxiliary `` and `` tags. They must be preserved during translation: `compose` uses them to restore the original markup. + +## extract parameters {#extract} + +#| +|| **Parameter** | **Description** || +|| `--source`, `-sl` | +Source language in ISO 639-1 format: `ru` or `ru-RU`. Required +|| +|| `--target`, `-tl` | +Target language: `en` or `en-US`. Can be passed multiple times - the export is performed for each language +|| +|| `--filter` | +Export only files reachable from `toc.yaml`. By default, all project files are exported +|| +|| `--schema` | +Paths to files with custom [translation schemas](translate.md#json-schemas) for YAML and JSON. Several paths can be specified +|| +|| `--no-ref-resolve` | +Do not resolve `$ref` in OpenAPI specifications during export +|| +|# + +The common parameters `--input`, `--output`, `--files`, `--include`, and `--exclude` are also supported - see [Localization](translate.md#options). + +## compose parameters {#compose} + +#| +|| **Parameter** | **Description** || +|| `--input`, `-i` | +Directory with `*.xliff` + `*.skl` pairs. Defaults to the directory the command is run from +|| +|| `--output`, `-o` | +Path to the project **root** where the assembled files should be saved. Defaults to `input` +|| +|| `--use-source` | +Assemble files from the source text (``) instead of the translation. Useful for debugging the export +|| +|# + +The `--include` and `--exclude` parameters filter file pairs the same way as during translation - see [Localization](translate.md#options). diff --git a/en/tools/docs/translate-yandex.md b/en/tools/docs/translate-yandex.md new file mode 100644 index 00000000..13a65f45 --- /dev/null +++ b/en/tools/docs/translate-yandex.md @@ -0,0 +1,49 @@ +--- +keywords: ['translate', 'yandex translate', 'machine translation', 'i18n', 'l10n'] +--- +# Machine translation + +Without the `--provider` option, the `{{PROGRAM}} translate` command translates documentation via [Yandex Translate](https://yandex.cloud/en/services/translate). This is the fastest translation method: it suits draft versions and regular language synchronization, but the result usually needs proofreading. For higher quality, use [AI translation](translate-ai.md) or [CAT tools](translate-xliff.md). + +## Usage {#usage} + +1. Get an authorization token: an [OAuth token](https://yandex.cloud/en/docs/iam/concepts/authorization/oauth-token), an [IAM token](https://yandex.cloud/en/docs/iam/concepts/authorization/iam-token), or a service account [API key](https://yandex.cloud/en/docs/iam/operations/api-key/create). +2. Find out the [folder ID](https://yandex.cloud/en/docs/resource-manager/operations/folder/get-id) for which your account has the `ai.translate.user` role or higher. +3. Estimate the translation volume without API requests: + + ```bash + {{PROGRAM}} translate -i ./docs --source ru --target en --auth --folder --dry-run + ``` + +4. Run the translation: + + ```bash + {{PROGRAM}} translate -i ./docs --source ru --target en --auth --folder + ``` + +Translated files appear in the target language folder - `docs/en` in the example above. + +## Parameters {#options} + +Common parameters (`--source`, `--target`, `--files`, `--include`, `--exclude`, `--dry-run`, and others) are described on the [Localization](translate.md#options) page. Below are the `yandex` provider parameters. + +#| +|| **Parameter** | **Description** || +|| `--auth` | +Authorization token: a value or a path to a file with the token. The type is detected by prefix: `y0_` - OAuth token, `t1.` - IAM token, `AQVN` - service account API key. Required +|| +|| `--folder` | +[Folder ID](https://yandex.cloud/en/docs/resource-manager/operations/folder/get-id) for which your account has the `ai.translate.user` role or higher. Required +|| +|| `--glossary` | +Path to a YAML file with a [glossary](https://yandex.cloud/en/docs/translate/concepts/glossary) - pairs of terms that must be translated in a fixed way +|| +|# + +## Limits {#limits} + +Yandex Translate has [limits](https://yandex.cloud/en/docs/translate/concepts/limits) on the amount of translated text. The CLI reduces the volume on its own: documents are split into segments, and repeated segments are translated once. + +If a limit is still exceeded, the command fails with the `TRANSLATE_LIMIT_EXCEED` error. In that case, retry later or narrow the file set with [filters](translate.md#options) - already translated files can be excluded. + +The `--dry-run` option helps estimate the text volume before running. diff --git a/en/tools/docs/translate.md b/en/tools/docs/translate.md index 39c9d1bf..74f53ae2 100644 --- a/en/tools/docs/translate.md +++ b/en/tools/docs/translate.md @@ -3,237 +3,152 @@ keywords: ['translate', 'xliff', 'cat', 'i18n', 'l10n', 'localization', 'interna --- # Localization -To translate documentation into different languages, the `{{PROGRAM}} translate` command is used, which provides fast [automatic translations](#auto). +The `{{PROGRAM}} translate` command translates project documentation from one language into others. Text is extracted from the markup, translated using the selected method, and assembled back into files - the project structure, markup, and code are preserved. -In addition to translation via [Yandex Translate](#auto), [AI translation](translate-ai.md) using large language models is supported (providers `yandexgpt`, `openai`, `openrouter` and `anthropic`). +In a multilingual project, each language version lives in its own language folder (`ru/`, `en/`, and so on) with its own `toc.yaml` and content files. -The `extract` and `compose` subcommands of this command allow working with [machine translation](#cat) systems (Computer Assisted Translation, or CAT), exchanging `*.xliff` files with them. +## Translation methods {#methods} -Translation is supported for both `*.md` files and `*.json` (including `*.yaml`) files according to the [described schemas](#json-schemas). +### Machine translation {#auto} -## Parameters for invoking the extract subcommand +Translation via [Yandex Translate](https://yandex.cloud/en/services/translate) - the default method, used when the `--provider` option is omitted. The fastest option, but the result usually needs proofreading. For details, see [Machine translation](translate-yandex.md). -#| -|| Parameter | Path -|| `--schema not_var{{optional}}` | -Путь до одного или нескольких файлов, содержащих кастомные схемы для перевода. -\ -`{{PROGRAM}} translate extract --schema ./some/path/to/file.yaml ./some/path/toAnother/file.yaml` -|# +### AI translation {#ai} -## Automatic translation {#auto} +Translation with large language models: the `yandexgpt`, `openai`, `openrouter`, and `anthropic` providers. Supports glossaries, prompts, a translation cache, and quality evaluation by a second model. For details, see [AI translation](translate-ai.md). -```bash -{{PROGRAM}} translate --source not_var{{translate.source}} --target not_var{{translate.target}} -``` +### XLIFF exchange with CAT tools {#cat} -Automatic translation can be performed using services such as [Yandex Translate](https://cloud.yandex.ru/docs/translate/){% if translate.google-support == true %} or [Cloud Translate](https://cloud.google.com/translate/docs){% endif %}. +If translation is done by people in a Computer Assisted Translation (CAT) tool, the `extract` subcommand exports the project text into `*.xliff` files, and `compose` assembles the translated files back into documentation. For details, see [XLIFF exchange with CAT tools](translate-xliff.md). -This mode is enabled by default: without the `--provider` option the `yandex` value is used, so the option is omitted in the examples below. +## How translation works {#pipeline} -These systems have [limits](https://cloud.yandex.ru/ru/docs/translate/concepts/limits) on the volume of translated documents and translation quality. However, they are characterized by high processing speed. +Each document is split into segments - sentences, headings, table cells. YFM markup, HTML tags, code, and Liquid constructs are not sent for translation: they stay in the document "skeleton", and after translation the segments are put back in place. Repeated segments are translated once. -To reduce the volume of text for translation, the document is split into shorter segments, such as sentences or headings. Repeated segments are then removed. +Files of each language live in their own language folder: sources, for example, in `ru/`, and the translation result in the target language folder, for example `en/`. You don't need to specify the language folder in paths - it is added automatically based on the `--source` and `--target` values. -To further reduce the volume of translations, `include` and `exclude` filters are supported. +## What is translated {#scope} -The `--dry-run` launch parameter can be used to determine the volume of text ready for translation. +By default, translation covers files matching `{lang}/**/*.@(md|yaml|json)`: -If limits are exceeded, the command will terminate with the error `TRANSLATE_LIMIT_EXCEED`. +* `*.md` - YFM markup text; +* `*.yaml` and `*.json` - only the fields described in a translation schema. -### Usage +### Translation schemas for YAML and JSON {#json-schemas} -* Translate a project in the current directory from `not_var{{translate.source-lang}}` to `not_var{{translate.target-lang}}`: +A schema defines which fields of a structured file contain translatable text. Built-in schemas exist for: - ```bash - {{PROGRAM}} translate --source not_var{{translate.source-lang}} --target not_var{{translate.target-lang}} - ``` +* `toc.yaml` tables of contents; +* [leading pages](../../project/leading-page.md) `index.yaml`; +* [variable presets](../../project/presets.md) `presets.yaml`; +* [Page constructor](../../project/page-constructor.md) pages. -* Do not translate hidden files in the project: +Custom schemas can be plugged in with the `--schema` option of the [extract](translate-xliff.md#extract) subcommand. - ```bash - {{PROGRAM}} translate --exclude not_var{{translate.source-lang}}/**/_*.* --source not_var{{translate.source-lang}} --target not_var{{translate.target-lang}} - ``` - -### Call parameters +## Common parameters {#options} -#### Main +These parameters work the same in all translation methods. Method-specific parameters are described in the articles on [machine translation](translate-yandex.md#options), [AI translation](translate-ai.md#options), and [XLIFF exchange](translate-xliff.md). #| -|| Parameter | Format | Description || -|| `--source`{{required}}| {{fmt.locale}} | -Language code of the original document in ISO 639-1 format -\ -`{{PROGRAM}} translate --source {{translate.source}}` +|| **Parameter** | **Description** || +|| `--source`, `-sl` | +Source document language in ISO 639-1 format: `ru` or `ru-RU`. Required || -|| `--target`{{required}}| {{fmt.locale}} | -Language code of the translated document in ISO 639-1 format -\ -`{{PROGRAM}} translate --target {{translate.target}}` +|| `--target`, `-tl` | +Target language: `en` or `en-US`. Can be passed multiple times - translation is performed into each language || -|| `--provider` | `yandex` \| `yandexgpt` \| `openai` \| `openrouter` \| `anthropic` | -Translation system. The default value is `yandex` - machine translation via [Yandex Translate](#auto). -\ -The other values enable [AI translation](translate-ai.md) using large language models. -\ -`{{PROGRAM}} translate --provider yandex` +|| `--input`, `-i` | +Path to the project **root** or to a specific file in the project. Defaults to the directory the command is run from || -|| `--input` | Path | -Path to the **root** of the project being translated or a specific file in the project. If not specified, the directory from which the command is launched is used. -\ -You do not need to specify the language directory in the path — it is added automatically. -\ -`{{PROGRAM}} translate -i ./docs` -\ -`{{PROGRAM}} translate -i ./docs/index.md` -\ -You can also specify a [filter file](#filter) as the path. -\ -`{{PROGRAM}} translate -i translate.list` +|| `--output`, `-o` | +Path to the project **root** where the translation should be saved. Defaults to `input` || -|| `--output` | Path | -Path to the **root** of the project where the translation should be saved. If not specified, the `input` directory is used. +|| `--files` | +Paths to files to translate (relative to `input`) or a path to a [list file](#file-filter). Can be repeated. When set, `--include` and `--exclude` are ignored || -|| `--include` | {{fmt.glob}} | -A set of rules for filtering files sent for translation. By default, `{lang}/**/*.@(md\|yaml\|json)`. -\ -Can be passed multiple times. -\ -Ignored if a [filter file](#filter) is used. -\ -`{{PROGRAM}} translate --include {{translate.source-lang}}/**/*.md` +|| `--include` | +Rule for selecting files: a path, a glob pattern, or a [list file](#file-filter). Can be repeated. The rules you pass replace the default rule; to restore it, add a separate `--include ...` rule || -|| `--exclude` | {{fmt.glob}} | -A set of rules that prohibit sending files for translation. Applied after `include`. -\ -Can be passed multiple times. -\ -`{{PROGRAM}} translate --exclude {{translate.source-lang}}/_no-translate/**/*.md` +|| `--exclude` | +Rule for excluding files: a path or a glob pattern. Applied after `--include`. Can be repeated || -|| `--include-vcs-diff` | Ref | +|| `--config`, `-c` | +Path to the configuration file. Defaults to `.yfm` in the project root +|| +|# + +### Provider translation parameters {#provider-options} + +These work when translating via [Yandex Translate](translate-yandex.md) and [AI providers](translate-ai.md), but not in the `extract` and `compose` subcommands. + +#| +|| **Parameter** | **Description** || +|| `--provider` | +Translation system: `yandex` (default), `yandexgpt`, `openai`, `openrouter`, or `anthropic` +|| +|| `--include-vcs-diff` | Adds files changed in the git or arc working copy to the translation. The `input` directory must be inside a repository. \ -The optional value is the ref against which the diff is computed (`HEAD` by default). Git-style ranges (`a..b`, `a...b`) work for both systems. Untracked files are always included. -\ -Combines with `--include`: files from both sets are translated. If there are no changes, the command finishes successfully without translation. -\ -`{{PROGRAM}} translate --include-vcs-diff` +The optional value is the ref to compute the diff against (defaults to `HEAD`). Git-syntax ranges (`a..b`, `a...b`) work for both systems. Untracked files are always included. \ -`{{PROGRAM}} translate --include-vcs-diff origin/main` +Combines with `--include`: files from both sets are translated. If there are no changes, the command finishes successfully without translation +|| +|| `--vars`, `-v` | +Build variables in JSON format. The `translate` command ignores `presets.yaml` - variables are passed only via this option +|| +|| `--dry-run` | +Do not translate, only estimate the amount of text and the number of provider requests +|| +|| `--copy-assets` | +Copy non-translatable files (images and other assets) from the source language folder to the target language folders, so the translated version builds on its own +|| +|| `--timeout` | +Timeout for a single translation API request, in milliseconds. Defaults to `5000` || |# -#### Translation system - -The set of additional options depends on the `--provider` value. Options for AI providers (`yandexgpt`, `openai`, `openrouter`, `anthropic`) are described in the [AI translation](translate-ai.md#options) article. - -{% list tabs %} - -- Yandex Translation - - #| - || Parameter | Format | Description || - || - - `--auth`{{required}} - - | - - Path - {{fmt.iam-token}} - {{fmt.api-key}} - - | - Authorization token. Can be passed in several ways: - \ - {{fmt.iam-token}} as a command-line parameter - \ - `{{PROGRAM}} translate --auth ` - \ - Path to a file that stores the {{fmt.iam-token}} - \ - `{{PROGRAM}} translate --auth path/to/.auth` - \ - Path to a file that stores the {{fmt.api-key}} of the service account. - \ - `{{PROGRAM}} translate --auth path/to/.api-key` - - || - || - - `--folder`{{required}} - - | - - Id - - | - [Identifier of the folder](https://cloud.yandex.ru/ru/docs/resource-manager/operations/folder/get-id) for which your account has the role `ai.translate.user` or higher. - || - || - - `--timeout` - - | - - Number - - | - - Translation wait time in milliseconds, default value is 5000 (5 seconds). - - || - |# - -{% endlist %} - -### File filtering {#file-filter} - -If you need to limit the translated texts to a fixed set of files, the flexible `include/exclude` filter mechanism may not be suitable. -In this case, you can create a file with the `*.list` extension. For example, `translate.list`. +### Fixed file list {#file-filter} + +If you need to limit translation to a known set of files, a list file - for example, `translate.list` - is more convenient than glob patterns. Pass it to the `--files` or `--include` parameter: +```bash +{{PROGRAM}} translate --files ./translate.list --source ru --target en ``` -# Файл поддерживает комментарии и пустые строки -# Пути до файлов должны быть сформированы относительно самого файла translate.list. +```text +# The file supports comments and empty lines + +# Paths are resolved relative to the translate.list file itself ./some/path/to/translated/file-1.md ./some/path/to/translated/file-2.md -# Пути до файлов не должны находиться выше, чем translate.list. -# Пример неправильного пути: +# Paths must not point above translate.list +# Example of an invalid path: ../some/path/to/translated/file.md ``` -Example of calling the command with a filter file +## Excluding content from translation {#content-filter} -```bash -{{PROGRAM}} translate --input ./translate.list --source not_var{{translate.source-lang}} --target not_var{{translate.target-lang}} -``` - -### Filtering page content {#content-filter} +Parts of the content can be excluded from translation right in the markup. -To exclude parts of content from translation, the platform provides the following syntactic constructs. +* `translate=no` - for code blocks: -* `translate=no` for code blocks: ```` ```sql translate=no - // этот блок не уйдёт на перевод SELECT * FROM posts WHERE id=123 LIMIT 1 ``` ```` -* `:no-translate` for string fragments (works in yaml and md files): +* `:no-translate[]` - for inline fragments (works in md and yaml files): + ``` - Формат даты: :no—translate[ISO 8601] со смещением относительно :no—translate[UTC]. + Date format: :no-translate[ISO 8601] with an offset from :no-translate[UTC]. ``` -* `:::no-translate` for content blocks: +* `:::no-translate` - for content blocks: + ``` - :::no–translate - // весь этот блок не уйдёт на перевод - Inconsistent indentation for list items at the same level: - * One - * Two - * Three + :::no-translate + This entire block will not be sent for translation. ::: ``` diff --git a/ru/toc.yaml b/ru/toc.yaml index c544d811..41c4494d 100644 --- a/ru/toc.yaml +++ b/ru/toc.yaml @@ -168,8 +168,12 @@ items: - name: Локализация href: tools/docs/translate.md items: + - name: Машинный перевод + href: tools/docs/translate-yandex.md - name: AI-перевод href: tools/docs/translate-ai.md + - name: Обмен XLIFF с CAT-системами + href: tools/docs/translate-xliff.md - name: Выкладка на S3 href: tools/docs/publish-s3.md - name: Portable-версия CLI diff --git a/ru/tools/docs/translate-ai.md b/ru/tools/docs/translate-ai.md index 45aeef4b..a38642eb 100644 --- a/ru/tools/docs/translate-ai.md +++ b/ru/tools/docs/translate-ai.md @@ -7,7 +7,7 @@ tags: Команда `{{PROGRAM}} translate` умеет переводить документацию большими языковыми моделями (LLM). Поддерживаются провайдеры `yandexgpt`, `openai`, `openrouter` и `anthropic`. -Пайплайн тот же, что и у [остальных провайдеров перевода](translate.md): текст извлекается из разметки, переводится и собирается обратно. Разметка Markdown, HTML-теги, код и Liquid-конструкции в модель не попадают - переводятся только текстовые сегменты. +Пайплайн тот же, что и у [остальных способов перевода](translate.md#pipeline): текст извлекается из разметки, переводится и собирается обратно. Разметка Markdown, HTML-теги, код и Liquid-конструкции в модель не попадают - переводятся только текстовые сегменты. Провайдер здесь описывает протокол API, а не конкретного вендора: любую совместимую инсталляцию (self-hosted модель, внутренний шлюз) можно подключить тем же провайдером, [заменив адрес API](#custom-api). @@ -92,11 +92,11 @@ Self-hosted модель или внутренний шлюз с совмест ## Справочник опций {#options} -Общие опции команды (`--source`, `--target`, `--files`, `--include`, `--exclude`, `--include-vcs-diff`, `--dry-run` и другие) описаны на странице [Локализация](translate.md). Опция `--target` может быть передана несколько раз - перевод выполнится на каждый язык. Ниже - опции AI-провайдеров. +Общие опции команды (`--source`, `--target`, `--files`, `--include`, `--exclude`, `--include-vcs-diff`, `--dry-run` и другие) описаны на странице [Локализация](translate.md#options). Опция `--target` может быть передана несколько раз - перевод выполнится на каждый язык. Ниже - опции AI-провайдеров. #| || **Опция** | **По умолчанию** | **Описание** || -|| `--provider` | `yandex` | Провайдер перевода. Для AI-перевода: `yandexgpt`, `openai`, `openrouter` или `anthropic`. Значение по умолчанию `yandex` - это машинный перевод [Yandex Translate](translate.md#auto), не LLM || +|| `--provider` | `yandex` | Провайдер перевода. Для AI-перевода: `yandexgpt`, `openai`, `openrouter` или `anthropic`. Значение по умолчанию `yandex` - это машинный перевод [Yandex Translate](translate-yandex.md), не LLM || || `--auth` | из переменной окружения | Токен или путь к файлу с токеном. В файл конфигурации класть нельзя || || `--model` | зависит от провайдера | Идентификатор модели || || `--fallback-model` | - | Резервная модель в том же формате, что `--model`. См. [Резервная модель](#fallback) || diff --git a/ru/tools/docs/translate-xliff.md b/ru/tools/docs/translate-xliff.md new file mode 100644 index 00000000..aacb400d --- /dev/null +++ b/ru/tools/docs/translate-xliff.md @@ -0,0 +1,107 @@ +--- +keywords: ['translate', 'xliff', 'cat', 'extract', 'compose', 'trados', 'smartcat', 'crowdin', 'перевод'] +tags: + - Локализация +--- +# Обмен XLIFF с CAT-системами + +Когда перевод выполняют люди - штатные переводчики или бюро переводов, - они обычно работают в системе автоматизированного перевода (Computer Assisted Translation, или CAT): Trados, Phrase, Smartcat, Crowdin и подобных. Стандартный формат обмена с такими системами - [XLIFF](https://en.wikipedia.org/wiki/XLIFF). + +Подкоманды `extract` и `compose` команды `{{PROGRAM}} translate` реализуют полный цикл такого перевода: + +1. `extract` выгружает переводимый текст проекта в `*.xliff` файлы. +2. Файлы переводятся в CAT-системе. +3. `compose` собирает переведенные `*.xliff` обратно в файлы документации. + +## Как это работает {#how-it-works} + +`extract` разбивает каждый файл документации на две части: + +* `<файл>.xliff` - переводимые сегменты: предложения, заголовки, ячейки таблиц; +* `<файл>.skl` - скелет: исходный файл, в котором на месте сегментов стоят маркеры. + +Разметка, код и Liquid-конструкции остаются в скелете и в CAT-систему не попадают - подробнее в разделе [Как устроен перевод](translate.md#pipeline). + +Оба файла сохраняются по пути целевого языка. Например, при переводе с `ru` на `en` из файла `ru/guide/index.md` получатся `en/guide/index.md.xliff` и `en/guide/index.md.skl`. + +`compose` выполняет обратную операцию: находит в директории пары `.xliff` + `.skl` и собирает из каждой переведенный файл - `en/guide/index.md`. Файлы без пары пропускаются с предупреждением. + +## Пример полного цикла {#example} + +```bash +# Выгрузить сегменты: в ./xliff появятся en/**/*.xliff и en/**/*.skl +{{PROGRAM}} translate extract -i ./docs -o ./xliff --source ru --target en + +# ...перевести *.xliff в CAT-системе... + +# Собрать переведенные файлы в ./docs/en +{{PROGRAM}} translate compose -i ./xliff -o ./docs +``` + +В CAT-систему передаются только `*.xliff` файлы, но при сборке переведенные `*.xliff` должны лежать рядом со своими `*.skl` - не удаляйте скелеты между шагами. + +После `compose` переведенная версия собирается обычным `{{PROGRAM}} build`. + +## Формат XLIFF {#format} + +`extract` создает XLIFF версии 1.2. Каждый сегмент - элемент `` с исходным текстом в ``. Перевод должен попасть в элемент `` - CAT-системы добавляют его сами: + +```xml + + + +
+ + + +
+ + + Заголовок документа + + +
+
+``` + +Инлайн-разметка внутри сегмента - выделение, ссылки, код - кодируется служебными тегами `` и ``. При переводе их нужно сохранять: по ним `compose` восстанавливает исходную разметку. + +## Параметры extract {#extract} + +#| +|| **Параметр** | **Описание** || +|| `--source`, `-sl` | +Язык оригинала в формате ISO 639-1: `ru` или `ru-RU`. Обязательный +|| +|| `--target`, `-tl` | +Язык перевода: `en` или `en-US`. Можно указать несколько раз - выгрузка выполнится для каждого языка +|| +|| `--filter` | +Выгружать только файлы, достижимые из `toc.yaml`. По умолчанию выгружаются все файлы проекта +|| +|| `--schema` | +Пути к файлам с собственными [схемами перевода](translate.md#json-schemas) для YAML и JSON. Можно указать несколько +|| +|| `--no-ref-resolve` | +Не разворачивать `$ref` в OpenAPI-спецификациях при выгрузке +|| +|# + +Также поддерживаются общие параметры `--input`, `--output`, `--files`, `--include` и `--exclude` - см. [Локализация](translate.md#options). + +## Параметры compose {#compose} + +#| +|| **Параметр** | **Описание** || +|| `--input`, `-i` | +Директория с парами `*.xliff` + `*.skl`. По умолчанию - директория запуска команды +|| +|| `--output`, `-o` | +Путь до **корня** проекта, в который нужно сохранить собранные файлы. По умолчанию совпадает с `input` +|| +|| `--use-source` | +Собрать файлы из исходного текста (``) вместо перевода. Полезно для отладки выгрузки +|| +|# + +Параметры `--include` и `--exclude` фильтруют пары файлов так же, как при переводе - см. [Локализация](translate.md#options). diff --git a/ru/tools/docs/translate-yandex.md b/ru/tools/docs/translate-yandex.md new file mode 100644 index 00000000..43d869cc --- /dev/null +++ b/ru/tools/docs/translate-yandex.md @@ -0,0 +1,51 @@ +--- +keywords: ['translate', 'yandex translate', 'машинный перевод', 'i18n', 'l10n', 'перевод'] +tags: + - Локализация +--- +# Машинный перевод + +Без опции `--provider` команда `{{PROGRAM}} translate` переводит документацию через [Yandex Translate](https://yandex.cloud/ru/services/translate). Это самый быстрый способ перевода: он подходит для черновых версий и регулярной синхронизации языков, но результат обычно требует вычитки. Для более качественного перевода используйте [AI-перевод](translate-ai.md) или [CAT-системы](translate-xliff.md). + +## Использование {#usage} + +1. Получите токен авторизации: [OAuth-токен](https://yandex.cloud/ru/docs/iam/concepts/authorization/oauth-token), [IAM-токен](https://yandex.cloud/ru/docs/iam/concepts/authorization/iam-token) или [API-ключ](https://yandex.cloud/ru/docs/iam/operations/api-key/create) сервисного аккаунта. +2. Узнайте [идентификатор каталога](https://yandex.cloud/ru/docs/resource-manager/operations/folder/get-id), для которого у аккаунта есть роль `ai.translate.user` или выше. +3. Оцените объем перевода без запросов к API: + + ```bash + {{PROGRAM}} translate -i ./docs --source ru --target en --auth <токен> --folder <идентификатор> --dry-run + ``` + +4. Запустите перевод: + + ```bash + {{PROGRAM}} translate -i ./docs --source ru --target en --auth <токен> --folder <идентификатор> + ``` + +Переведенные файлы появятся в папке целевого языка - в примере выше это `docs/en`. + +## Параметры {#options} + +Общие параметры (`--source`, `--target`, `--files`, `--include`, `--exclude`, `--dry-run` и другие) описаны на странице [Локализация](translate.md#options). Ниже - параметры провайдера `yandex`. + +#| +|| **Параметр** | **Описание** || +|| `--auth` | +Токен авторизации: значение или путь к файлу с токеном. Тип определяется по префиксу: `y0_` - OAuth-токен, `t1.` - IAM-токен, `AQVN` - API-ключ сервисного аккаунта. Обязательный +|| +|| `--folder` | +[Идентификатор каталога](https://yandex.cloud/ru/docs/resource-manager/operations/folder/get-id), для которого у аккаунта есть роль `ai.translate.user` или выше. Обязательный +|| +|| `--glossary` | +Путь к YAML-файлу с [глоссарием](https://yandex.cloud/ru/docs/translate/concepts/glossary) - парами терминов, которые нужно переводить фиксированно +|| +|# + +## Лимиты {#limits} + +У Yandex Translate есть [ограничения](https://yandex.cloud/ru/docs/translate/concepts/limits) на объем переводимого текста. CLI сокращает объем сам: документы разбиваются на сегменты, повторяющиеся сегменты переводятся один раз. + +Если лимит все же превышен, команда завершается ошибкой `TRANSLATE_LIMIT_EXCEED`. В этом случае повторите запуск позже или сузьте набор файлов [фильтрами](translate.md#options) - уже переведенные файлы можно исключить. + +Оценить объем текста до запуска помогает опция `--dry-run`. diff --git a/ru/tools/docs/translate.md b/ru/tools/docs/translate.md index d6fbc2d7..fe2270ed 100644 --- a/ru/tools/docs/translate.md +++ b/ru/tools/docs/translate.md @@ -1,241 +1,156 @@ --- -keywords: ['translate', 'xliff', 'cat', 'i18n', 'l10n', 'localization', 'internationalization'] +keywords: ['translate', 'xliff', 'cat', 'i18n', 'l10n', 'localization', 'internationalization', 'перевод', 'локализация'] tags: - Локализация --- # Локализация -Для перевода документации на разные языки используется команда `{{PROGRAM}} translate`, которая обеспечивает быстрые [автоматические переводы](#auto). +Команда `{{PROGRAM}} translate` переводит документацию проекта с одного языка на другие. Текст извлекается из разметки, переводится выбранным способом и собирается обратно в файлы - структура проекта, разметка и код при этом сохраняются. -Помимо перевода через [Yandex Translate](#auto), поддерживается [AI-перевод](translate-ai.md) большими языковыми моделями (провайдеры `yandexgpt`, `openai`, `openrouter` и `anthropic`). +О том, как устроен проект с несколькими языковыми версиями, читайте в статье [Многоязычные проекты](../../guides/multilingual-projects.md). -Подкоманды `extract` и `compose` этой команды позволяют работать с системами [машинного перевода](#cat) (Computer Assisted Translation, или CAT), обмениваясь с ними `*.xliff` файлами. +## Способы перевода {#methods} -Поддерживается перевод как `*.md` файлов, так и `*.json` (в том числе `*.yaml`) файлов по [описанным схемам](#json-schemas). +### Машинный перевод {#auto} -## Параметры вызова подкоманды extract +Перевод через [Yandex Translate](https://yandex.cloud/ru/services/translate) - способ по умолчанию, работает без опции `--provider`. Самый быстрый вариант, но результат обычно требует вычитки. Подробности - в статье [Машинный перевод](translate-yandex.md). -#| -|| Параметр | Path -|| `--schema not_var{{optional}}` | -Путь до одного или нескольких файлов, содержащих кастомные схемы для перевода. -\ -`{{PROGRAM}} translate extract --schema ./some/path/to/file.yaml ./some/path/toAnother/file.yaml` -|# +### AI-перевод {#ai} -## Автоматический перевод {#auto} +Перевод большими языковыми моделями: провайдеры `yandexgpt`, `openai`, `openrouter` и `anthropic`. Поддерживает глоссарии, промпты, кэш переводов и оценку качества второй моделью. Подробности - в статье [AI-перевод](translate-ai.md). -```bash -{{PROGRAM}} translate --source not_var{{translate.source}} --target not_var{{translate.target}} -``` +### Обмен XLIFF с CAT-системами {#cat} -Автоматический перевод может быть выполнен с использованием таких сервисов, как [Yandex Translate](https://cloud.yandex.ru/docs/translate/){% if translate.google-support == true %} или [Cloud Translate](https://cloud.google.com/translate/docs){% endif %}. +Если перевод выполняют люди в системе автоматизированного перевода (Computer Assisted Translation, или CAT), подкоманда `extract` выгружает текст проекта в `*.xliff` файлы, а `compose` собирает переведенные файлы обратно в документацию. Подробности - в статье [Обмен XLIFF с CAT-системами](translate-xliff.md). -Этот режим включен по умолчанию: без опции `--provider` используется значение `yandex`, поэтому в примерах ниже опция опущена. +## Как устроен перевод {#pipeline} -У этих систем есть [ограничения](https://cloud.yandex.ru/ru/docs/translate/concepts/limits) по объему переводимых документов и качеству перевода. Однако они отличаются высокой скоростью работы. +Каждый документ разбивается на сегменты - предложения, заголовки, ячейки таблиц. Разметка YFM, HTML-теги, код и Liquid-конструкции на перевод не отправляются: они остаются в «скелете» документа, и после перевода сегменты подставляются обратно на свои места. Повторяющиеся сегменты переводятся один раз. -Для уменьшения объема текста для перевода документ разбивается на более короткие сегменты, например, предложения или заголовки. Повторяющиеся сегменты затем удаляются. +Файлы каждого языка лежат в своей [языковой папке](../../guides/multilingual-projects.md#language-folder): исходные - например, в `ru/`, результат перевода - в папке целевого языка, например `en/`. Указывать языковую папку в путях не нужно - она добавляется автоматически по значениям `--source` и `--target`. -Также для уменьшения объема переводов поддерживаются `include` и `exclude` фильтры. +## Что переводится {#scope} -Параметр запуска `--dry-run` может быть использован для определения объема текста, готового к переводу. +По умолчанию на перевод попадают файлы `{lang}/**/*.@(md|yaml|json)`: -Если лимиты превышены, команда завершится с ошибкой `TRANSLATE_LIMIT_EXCEED`. +* `*.md` - текст YFM-разметки; +* `*.yaml` и `*.json` - только поля, описанные в схеме перевода. -### Использование +### Схемы перевода YAML и JSON {#json-schemas} -* Перевести проект в текущей директории с `not_var{{translate.source-lang}}` на `not_var{{translate.target-lang}}`: +Схема определяет, какие поля структурированного файла содержат переводимый текст. Встроенные схемы есть для: - ```bash - {{PROGRAM}} translate --source not_var{{translate.source-lang}} --target not_var{{translate.target-lang}} - ``` +* оглавлений `toc.yaml`; +* [разводящих страниц](../../project/leading-page.md) `index.yaml`; +* [пресетов переменных](../../project/presets.md) `presets.yaml`; +* страниц [Page constructor](../../project/page-constructor.md). -* Не переводить скрытые файлы в проекте: +Собственные схемы можно подключить опцией `--schema` подкоманды [extract](translate-xliff.md#extract). - ```bash - {{PROGRAM}} translate --exclude not_var{{translate.source-lang}}/**/_*.* --source not_var{{translate.source-lang}} --target not_var{{translate.target-lang}} - ``` - -### Параметры вызова +## Общие параметры {#options} -#### Основные +Эти параметры работают во всех способах перевода. Специфичные параметры описаны в статьях про [машинный перевод](translate-yandex.md#options), [AI-перевод](translate-ai.md#options) и [обмен XLIFF](translate-xliff.md). #| -|| Параметр | Формат | Описание || -|| `--source`{{required}}| {{fmt.locale}} | -Код языка оригинального документа в формате ISO 639-1 -\ -`{{PROGRAM}} translate --source {{translate.source}}` +|| **Параметр** | **Описание** || +|| `--source`, `-sl` | +Язык оригинала в формате ISO 639-1: `ru` или `ru-RU`. Обязательный || -|| `--target`{{required}}| {{fmt.locale}} | -Код языка переведенного документа в формате ISO 639-1 -\ -`{{PROGRAM}} translate --target {{translate.target}}` +|| `--target`, `-tl` | +Язык перевода: `en` или `en-US`. Можно указать несколько раз - перевод выполнится на каждый язык || -|| `--provider` | `yandex` \| `yandexgpt` \| `openai` \| `openrouter` \| `anthropic` | -Система перевода. Значение по умолчанию - `yandex`, машинный перевод через [Yandex Translate](#auto). -\ -Остальные значения включают [AI-перевод](translate-ai.md) большими языковыми моделями. -\ -`{{PROGRAM}} translate --provider yandex` +|| `--input`, `-i` | +Путь до **корня** проекта или до конкретного файла в проекте. По умолчанию - директория запуска команды || -|| `--input` | Path | -Путь до **корня** переводимого проекта или конкретного файла в проекте. Если не указан, используется директория запуска команды. -\ -Директорию языка в пути указывать не надо — она добавляется автоматически. -\ -`{{PROGRAM}} translate -i ./docs` -\ -`{{PROGRAM}} translate -i ./docs/index.md` -\ -Также в качестве пути можно указать [файл фильтр](#filter). -\ -`{{PROGRAM}} translate -i translate.list` +|| `--output`, `-o` | +Путь до **корня** проекта, в который нужно сохранить перевод. По умолчанию совпадает с `input` || -|| `--output` | Path | -Путь до **корня** проекта, в который нужно сохранить перевод. Если не указан, используется `input` директория. +|| `--files` | +Пути к файлам для перевода (относительно `input`) или путь к [файлу со списком](#file-filter). Можно повторять. Если параметр задан, `--include` и `--exclude` игнорируются || -|| `--include` | {{fmt.glob}} | -Набор правил для фильтрации отправляемых на перевод файлов. По умолчанию `{lang}/**/*.@(md\|yaml\|json)`. -\ -Может быть передан несколько раз. -\ -Игнорируется, если используется [файл фильтр](#filter). -\ -`{{PROGRAM}} translate --include {{translate.source-lang}}/**/*.md` +|| `--include` | +Правило отбора файлов: путь, glob-шаблон или [файл со списком](#file-filter). Можно повторять. Заданные правила заменяют правило по умолчанию; чтобы вернуть его, добавьте отдельное правило `--include ...` || -|| `--exclude` | {{fmt.glob}} | -Набор правил, запрещающих отправлять файлы на перевод. Применяется после `include`. -\ -Может быть передан несколько раз. -\ -`{{PROGRAM}} translate --exclude {{translate.source-lang}}/_no-translate/**/*.md` +|| `--exclude` | +Правило исключения файлов: путь или glob-шаблон. Применяется после `--include`. Можно повторять || -|| `--include-vcs-diff` | Ref | +|| `--config`, `-c` | +Путь к файлу конфигурации. По умолчанию - `.yfm` в корне проекта +|| +|# + +### Параметры перевода через провайдера {#provider-options} + +Работают при переводе через [Yandex Translate](translate-yandex.md) и [AI-провайдеров](translate-ai.md), но не в подкомандах `extract` и `compose`. + +#| +|| **Параметр** | **Описание** || +|| `--provider` | +Система перевода: `yandex` (по умолчанию), `yandexgpt`, `openai`, `openrouter` или `anthropic` +|| +|| `--include-vcs-diff` | Добавляет к переводу файлы, измененные в рабочей копии git или arc. Директория `input` должна находиться внутри репозитория. \ Необязательное значение - реф, относительно которого считается diff (по умолчанию `HEAD`). Диапазоны в git-синтаксисе (`a..b`, `a...b`) работают для обеих систем. Неотслеживаемые файлы включаются всегда. \ -Комбинируется с `--include`: переводятся файлы из обоих наборов. Если изменений нет, команда успешно завершается без перевода. -\ -`{{PROGRAM}} translate --include-vcs-diff` -\ -`{{PROGRAM}} translate --include-vcs-diff origin/main` +Комбинируется с `--include`: переводятся файлы из обоих наборов. Если изменений нет, команда успешно завершается без перевода +|| +|| `--vars`, `-v` | +Переменные сборки в формате JSON. Команда `translate` игнорирует `presets.yaml` - переменные передаются только этой опцией +|| +|| `--dry-run` | +Не выполнять перевод, а только посчитать объем текста и количество запросов к провайдеру +|| +|| `--copy-assets` | +Скопировать непереводимые файлы (изображения и другие ассеты) из папки исходного языка в папки целевых языков, чтобы переведенная версия собиралась самостоятельно +|| +|| `--timeout` | +Время ожидания одного запроса к API перевода в миллисекундах. По умолчанию - `5000` || |# -#### Система переводов - -Набор дополнительных опций зависит от значения `--provider`. Опции AI-провайдеров (`yandexgpt`, `openai`, `openrouter`, `anthropic`) описаны в статье [AI-перевод](translate-ai.md#options). - -{% list tabs %} - -- Yandex Translation - - #| - || Параметр | Формат | Описание || - || - - `--auth`{{required}} - - | - - Path - {{fmt.iam-token}} - {{fmt.api-key}} - - | - Токен авторизации. Может быть передан несколькими способами: - \ - {{fmt.iam-token}} как параметр командной строки - \ - `{{PROGRAM}} translate --auth ` - \ - Путь до файла, в котором хранится {{fmt.iam-token}} - \ - `{{PROGRAM}} translate --auth path/to/.auth` - \ - Путь до файла, в котором хранится {{fmt.api-key}} сервисного аккаунта. - \ - `{{PROGRAM}} translate --auth path/to/.api-key` - - || - || - - `--folder`{{required}} - - | - - Id - - | - [Идентификатор каталога](https://cloud.yandex.ru/ru/docs/resource-manager/operations/folder/get-id), для которого у вашего аккаунта есть роль `ai.translate.user` или выше. - || - || - - `--timeout` - - | - - Число - - | - - Время ожидания перевода в миллисекундах, значение по умолчанию — 5000 (5 секунд). - - || - |# - -{% endlist %} - -### Фильтрация файлов {#file-filter} - -Если необходимо ограничить переводимые тексты фиксированным набором файлов, механизм гибких фильтров `include/exclude` может не подойти. -В таком случае можно сформировать файл с расширением `*.list`. Например `translate.list`. +### Фиксированный список файлов {#file-filter} + +Если нужно ограничить перевод заранее известным набором файлов, вместо glob-шаблонов удобнее файл со списком - например, `translate.list`. Он передается в параметр `--files` или `--include`: +```bash +{{PROGRAM}} translate --files ./translate.list --source ru --target en ``` + +```text # Файл поддерживает комментарии и пустые строки -# Пути до файлов должны быть сформированы относительно самого файла translate.list. +# Пути формируются относительно самого файла translate.list ./some/path/to/translated/file-1.md ./some/path/to/translated/file-2.md -# Пути до файлов не должны находиться выше, чем translate.list. +# Пути не должны находиться выше, чем translate.list # Пример неправильного пути: ../some/path/to/translated/file.md ``` -Пример вызова команды с файлом фильтром +## Исключение контента из перевода {#content-filter} -```bash -{{PROGRAM}} translate --input ./translate.list --source not_var{{translate.source-lang}} --target not_var{{translate.target-lang}} -``` - -### Фильтрация контента страниц {#content-filter} +Части контента можно исключить из перевода прямо в разметке. -Для исключения частей контента из перевода на платформе предусмотрены следующие синтаксические конструкции. +* `translate=no` - для блоков кода: -* `translate=no` для блоков кода: ```` ```sql translate=no - // этот блок не уйдёт на перевод SELECT * FROM posts WHERE id=123 LIMIT 1 ``` ```` -* `:no-translate` для строковых фрагментов (работает в yaml- и в md-файлах): +* `:no-translate[]` - для строковых фрагментов (работает в md- и yaml-файлах): + ``` - Формат даты: :no—translate[ISO 8601] со смещением относительно :no—translate[UTC]. + Формат даты: :no-translate[ISO 8601] со смещением относительно :no-translate[UTC]. ``` -* `:::no-translate` для блоков контента: +* `:::no-translate` - для блоков контента: + ``` - :::no–translate - // весь этот блок не уйдёт на перевод - Inconsistent indentation for list items at the same level: - * One - * Two - * Three + :::no-translate + Весь этот блок не уйдет на перевод. ::: ```