docs: add new i18n formats to i18n guide (#42597)

PR Close #42597
This commit is contained in:
Németh Tamás 2021-06-17 23:49:57 +01:00 committed by Dylan Hunn
parent a9dd7e21a2
commit 6b2a475532
2 changed files with 10 additions and 6 deletions

View File

@ -80,7 +80,7 @@ Tip: In the [API reference section](api) of this site, deprecated APIs are indic
| API | Replacement | Deprecation announced | Notes |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------- | --------------------- | ----- |
| [`CurrencyPipe` - `DEFAULT_CURRENCY_CODE`](api/common/CurrencyPipe#currency-code-deprecation) | `{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}` | v9 | From v11 the default code will be extracted from the locale data given by `LOCAL_ID`, rather than `USD`. |
| [`CurrencyPipe` - `DEFAULT_CURRENCY_CODE`](api/common/CurrencyPipe#currency-code-deprecation) | `{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}` | v9 | From v11 the default code will be extracted from the locale data given by `LOCALE_ID`, rather than `USD`. |
{@a common-http}

View File

@ -327,7 +327,7 @@ You can also nest different clauses together, such as the `plural` and `select`
## Work with translation files
After preparing a template for translation, use the Angular CLI `extract-i18n` command to extract the marked text in the template into a _source language_ file.
After preparing a template for translation, use the Angular CLI [`extract-i18n`](cli/extract-i18n) command to extract the marked text in the template into a _source language_ file.
The marked text includes text marked with `i18n` and attributes marked with `i18n-`*attribute* as described in the previous section.
Follow these steps:
@ -349,7 +349,7 @@ To extract the source language file, open a terminal window, change to the root
The `extract-i18n` command creates a source language file named `messages.xlf` in your project's root directory using the [XML Localization Interchange File Format (XLIFF, version 1.2)](https://en.wikipedia.org/wiki/XLIFF "Wikipedia page about XLIFF").
Use the following `extract-i18n` command options to change the source language file location, format, and file name:
Use the following [`extract-i18n` command options](cli/extract-i18n) to change the source language file location, format, and file name:
* `--output-path`: Change the location.
* `--format`: Change the format.
@ -375,6 +375,8 @@ The `extract-i18n` command can read and write files in three translation formats
* XLIFF 1.2 (default)
* XLIFF 2
* [XML Message Bundle (XMB)](http://cldr.unicode.org/development/development-process/design-proposals/xmb)
* JSON
* [ARB](https://github.com/google/app-resource-bundle/wiki/ApplicationResourceBundleSpecification)
Specify the translation format explicitly with the `--format` command option, as shown in the following examples:
@ -382,6 +384,8 @@ Specify the translation format explicitly with the `--format` command option, as
ng extract-i18n --format=xlf
ng extract-i18n --format=xlf2
ng extract-i18n --format=xmb
ng extract-i18n --format=json
ng extract-i18n --format=arb
</code-example>
<div class="alert is-helpful">
@ -433,7 +437,7 @@ Follow these steps:
> The `id="introductionHeader"` is a [custom ID](#custom-id "Manage marked text with custom IDs"), but without the `@@` prefix required in the source HTML.
2. Duplicate the `<source>...</source>` element in the text node, rename it `target`, and then replace its content with the French text:
2. Duplicate the `<source>...</source>` element in the text node, rename it to `target`, and then replace its content with the French text:
> <code-example path="i18n/doc-files/messages.fr.xlf.html" region="translated-hello" header="src/locale/messages.fr.xlf (&lt;trans-unit&gt;, after translation)"></code-example>
@ -448,7 +452,7 @@ Follow these steps:
Don't change the IDs for translation units.
Each `id` is generated by Angular and depends on the content of the template text and its assigned meaning.
If you change either the text or the meaning, then the `id` changes.
For more about managing text updates and IDs, see the previous section on [custom IDs](#custom-id "Manage marked text with custom IDs").
For more about managing text updates and IDs, see the section on [custom IDs](#custom-id "Manage marked text with custom IDs").
</div>
@ -540,7 +544,7 @@ development and production builds, and AOT is required to localize component tem
<div class="alert is-helpful">
For a detailed explanation the build process, see [Building and serving Angular apps](guide/build "Building and serving Angular apps").
For a detailed explanation of the build process, see [Building and serving Angular apps](guide/build "Building and serving Angular apps").
This build process works for translation files in the `.xlf` format or in another format that Angular understands, such as `.xtb`.
</div>