|
|
|
@@ -132,20 +132,20 @@ The following actions describe the translation process for French.
|
|
|
|
|
1. Open `messages.fr.xlf` and find the first `<trans-unit>` element.
|
|
|
|
|
This is a _translation unit_, also known as a _text node_, that represents the translation of the `<h1>` greeting tag that was previously marked with the `i18n` attribute.
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translated-hello-before"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translated-hello-before"/>
|
|
|
|
|
|
|
|
|
|
The `id="introductionHeader"` is a [custom ID][GuideI18nOptionalManageMarkedText], but without the `@@` prefix required in the source HTML.
|
|
|
|
|
|
|
|
|
|
1. Duplicate the `<source>... </source>` element in the text node, rename it to `target`, and then replace the content with the French text.
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>, after translation)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translated-hello"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>, after translation)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translated-hello"/>
|
|
|
|
|
|
|
|
|
|
In a more complex translation, the information and context in the [description and meaning elements][GuideI18nCommonPrepareAddHelpfulDescriptionsAndMeanings] help you choose the right words for translation.
|
|
|
|
|
|
|
|
|
|
1. Translate the other text nodes.
|
|
|
|
|
The following example displays the way to translate.
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translated-other-nodes"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translated-other-nodes"/>
|
|
|
|
|
|
|
|
|
|
IMPORTANT: Don't change the IDs for translation units.
|
|
|
|
|
Each `id` attribute is generated by Angular and depends on the content of the component text and the assigned meaning.
|
|
|
|
@@ -169,7 +169,7 @@ To translate a `plural`, translate the ICU format match values.
|
|
|
|
|
|
|
|
|
|
The following example displays the way to translate.
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translated-plural"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translated-plural"/>
|
|
|
|
|
|
|
|
|
|
## Translate alternate expressions
|
|
|
|
|
|
|
|
|
@@ -184,18 +184,18 @@ The following example displays a `select` ICU expression in the component templa
|
|
|
|
|
In this example, Angular extracts the expression into two translation units.
|
|
|
|
|
The first contains the text outside of the `select` clause, and uses a placeholder for `select` \(`<x id="ICU">`\):
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translate-select-1"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translate-select-1"/>
|
|
|
|
|
|
|
|
|
|
IMPORTANT: When you translate the text, move the placeholder if necessary, but don't remove it.
|
|
|
|
|
If you remove the placeholder, the ICU expression is removed from your translated application.
|
|
|
|
|
|
|
|
|
|
The following example displays the second translation unit that contains the `select` clause.
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translate-select-2"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translate-select-2"/>
|
|
|
|
|
|
|
|
|
|
The following example displays both translation units after translation is complete.
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translated-select"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translated-select"/>
|
|
|
|
|
|
|
|
|
|
## Translate nested expressions
|
|
|
|
|
|
|
|
|
@@ -206,15 +206,15 @@ Angular extracts the expression into two translation units.
|
|
|
|
|
|
|
|
|
|
The following example displays the first translation unit that contains the text outside of the nested expression.
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translate-nested-1"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translate-nested-1"/>
|
|
|
|
|
|
|
|
|
|
The following example displays the second translation unit that contains the complete nested expression.
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translate-nested-2"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translate-nested-2"/>
|
|
|
|
|
|
|
|
|
|
The following example displays both translation units after translating.
|
|
|
|
|
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translate-nested"/>
|
|
|
|
|
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" region="translate-nested"/>
|
|
|
|
|
|
|
|
|
|
## What's next
|
|
|
|
|
|
|
|
|
|