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">

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.

For more details visit the Angular.io website documentation.


Popular posts from this blog

Angular 2/4 Content Translation using ngx-translate

Angular 2/4 NGX Translate Complete Implementation with Example

Angular 2/4 and TypeScript Dynamically Access/Append HTML Nodes