Last active
October 20, 2016 08:20
-
-
Save bettysteger/a0cc19c2296a98f93e48f1bfb5ddb676 to your computer and use it in GitHub Desktop.
ng-xi18n: Extracts texts and creates a XLIFF file in Angular 2, ready for translation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'my-app', | |
template: ` | |
<h1 i18n>Hello world</h1> | |
<p i18n="example description">This is an {{details}} paragraph</p> | |
<p>should not be translated</p> | |
<p i18n>I ❤ LingoHub</p> | |
` | |
}) | |
export class AppComponent { | |
details = 'example'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | |
<file source-language="en" datatype="plaintext" original="ng2.template"> | |
<body> | |
<trans-unit id="c8793269a943c10686b41f4f4f890875016783fc" datatype="html"> | |
<source>Hello world</source> | |
<target/> | |
</trans-unit> | |
<trans-unit id="1ecda48b29cdbe90ec39cf2fc0e93c87819a563d" datatype="html"> | |
<source>This is an <x id="INTERPOLATION"/> paragraph</source> | |
<target/> | |
<note priority="1" from="description">example description</note> | |
</trans-unit> | |
<trans-unit id="dfac9682a27fa25dcb19affd925d2b341798bf12" datatype="html"> | |
<source>I ❤ LingoHub</source> | |
<target/> | |
</trans-unit> | |
</body> | |
</file> | |
</xliff> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment