Template Translation - Angular 2/4 and i18n
There are four phases in the i18n template translation process:
1. Marking the template element inside the component for translation.
e.g. <span i18n>Hello i18n</span>
<img [src]="Logo" i18n-title title="Angular4 Logo"/>
2. Angular i18n tool will extract the marked elements into standard translation source file.
3. Edit the file and insert target language.
<trans-unit id="244bcd334kdda82506d258137adf23412c" datatype="html">
<source>Email</source>
<target>Email</target>
</trans-unit>
4. The compiler imports the translation files, replaces the original messages with the target you set in step 3 and generates fresh version of the app.
<hr/>
For more details visit the Angular.io website documentation.
1. Marking the template element inside the component for translation.
e.g. <span i18n>Hello i18n</span>
<img [src]="Logo" i18n-title title="Angular4 Logo"/>
2. Angular i18n tool will extract the marked elements into standard translation source file.
3. Edit the file and insert target language.
<trans-unit id="244bcd334kdda82506d258137adf23412c" datatype="html">
<source>Email</source>
<target>Email</target>
</trans-unit>
4. The compiler imports the translation files, replaces the original messages with the target you set in step 3 and generates fresh version of the app.
<hr/>
For more details visit the Angular.io website documentation.
Comments
Post a Comment