The "official" way to lighten the I18N in Angular seems pretty complicated:
The i18n template conversion process has four phases:
Mark static text messages in component templates for translation.
The angular i18n tool extracts tagged messages to a standard translation source file.
The translator edits this file, translates the extracted text messages into the target language, and returns the file to you.
The angular compiler imports completed translation files, replaces the original messages with translated text, and generates a new version of the application in the target language.
You need to create and deploy a separate version of the application for each supported language.
Some quirks are mentioned:
and)
Plural translation and message selection are a bit more complicated.
The tag is empty for the plural and selects translation units, which makes it difficult to compare them with the original template. XLIFF format does not yet support ICU rules; it will be soon.
b)
Maintenance and translation file changes
As your application evolves, you will change the i18n markup and run the ng-xi18n extraction tool many times. The new markup you add is not a problem; but most changes to the existing markup trigger generate new identifiers for the affected translation units.
. . , , , .
, messages.xlf. messages.xlf .
. , , . , .
<img [src]="logo" i18n-title="<meaning>|<description>" title="Angular 2 logo" />
, .
, , , ? JSON , ( ) , JavaScript ? . , , , Java.