Fixing angular i18n regeneration process.

master
Tomasz Półgrabia 2021-01-03 17:17:15 +01:00
parent 6075326683
commit 313747938e
6 changed files with 212 additions and 33 deletions

View File

@ -4,7 +4,8 @@ Angular version of frontend for a simple people management application.
## How to add new translations ## How to add new translations
ng extract-i18n --out-file src/locale/messages.de.xlf ng extract-i18n --out-file src/locale/messages.xlf
&& xliffmerge -p .\xliffmerge.dev.json de
## Development server ## Development server

View File

@ -129,14 +129,29 @@
} }
}, },
"@angular-devkit/schematics": { "@angular-devkit/schematics": {
"version": "11.0.4", "version": "11.0.5",
"resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-11.0.4.tgz", "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-11.0.5.tgz",
"integrity": "sha512-fFC7qW9A1bFAZgpCfkezBA4WCRzfVFgOzwPpyt65rgSrzw0+EeHjcrUIcXlhyOXAFrTHtA9oLCfEeSjSx5HBEA==", "integrity": "sha512-0NKGC8Nf/4vvDpWKB7bwxIazvNnNHnZBX6XlyBXNl+fW8tpTef3PNMJMSErTz9LFnuv61vsKbc36u/Ek2YChWg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@angular-devkit/core": "11.0.4", "@angular-devkit/core": "11.0.5",
"ora": "5.1.0", "ora": "5.1.0",
"rxjs": "6.6.3" "rxjs": "6.6.3"
},
"dependencies": {
"@angular-devkit/core": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-11.0.5.tgz",
"integrity": "sha512-hwV8fjF8JNPJkiVWw8MNzeIfDo01aD/OAOlC4L5rQnVHn+i2EiU3brSDmFqyeHPPV3h/QjuBkS3tkN7gSnVWaQ==",
"dev": true,
"requires": {
"ajv": "6.12.6",
"fast-json-stable-stringify": "2.1.0",
"magic-string": "0.25.7",
"rxjs": "6.6.3",
"source-map": "0.7.3"
}
}
} }
}, },
"@angular/animations": { "@angular/animations": {
@ -148,20 +163,20 @@
} }
}, },
"@angular/cli": { "@angular/cli": {
"version": "11.0.4", "version": "11.0.5",
"resolved": "https://registry.npmjs.org/@angular/cli/-/cli-11.0.4.tgz", "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-11.0.5.tgz",
"integrity": "sha512-VkE/gx6P80EJHg13fG+gkZfd2DJmRaDAtnamcCGM4AThzoUN9XBdxc24uMLEzBb0/mJ4vpMK9+WTNIdMmzl+Tg==", "integrity": "sha512-k4j/2z7qkuigJ1shH0McW1wW63clhrbrg98FK4/KWhU/sce5AgVjuHDQFycAclTwHesf7Vs6Gzt7zGlqUmeKIg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@angular-devkit/architect": "0.1100.4", "@angular-devkit/architect": "0.1100.5",
"@angular-devkit/core": "11.0.4", "@angular-devkit/core": "11.0.5",
"@angular-devkit/schematics": "11.0.4", "@angular-devkit/schematics": "11.0.5",
"@schematics/angular": "11.0.4", "@schematics/angular": "11.0.5",
"@schematics/update": "0.1100.4", "@schematics/update": "0.1100.5",
"@yarnpkg/lockfile": "1.1.0", "@yarnpkg/lockfile": "1.1.0",
"ansi-colors": "4.1.1", "ansi-colors": "4.1.1",
"debug": "4.2.0", "debug": "4.2.0",
"ini": "1.3.5", "ini": "1.3.6",
"inquirer": "7.3.3", "inquirer": "7.3.3",
"npm-package-arg": "8.1.0", "npm-package-arg": "8.1.0",
"npm-pick-manifest": "6.1.0", "npm-pick-manifest": "6.1.0",
@ -175,6 +190,29 @@
"uuid": "8.3.1" "uuid": "8.3.1"
}, },
"dependencies": { "dependencies": {
"@angular-devkit/architect": {
"version": "0.1100.5",
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1100.5.tgz",
"integrity": "sha512-yOYfucNouc1doTbcGbCNMXGMSc36+j97XpdNoeGyzFQ7GwezLAro0a9gxc5PdOxndfelkND7J1JuOjxdW5O17A==",
"dev": true,
"requires": {
"@angular-devkit/core": "11.0.5",
"rxjs": "6.6.3"
}
},
"@angular-devkit/core": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-11.0.5.tgz",
"integrity": "sha512-hwV8fjF8JNPJkiVWw8MNzeIfDo01aD/OAOlC4L5rQnVHn+i2EiU3brSDmFqyeHPPV3h/QjuBkS3tkN7gSnVWaQ==",
"dev": true,
"requires": {
"ajv": "6.12.6",
"fast-json-stable-stringify": "2.1.0",
"magic-string": "0.25.7",
"rxjs": "6.6.3",
"source-map": "0.7.3"
}
},
"debug": { "debug": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
@ -184,6 +222,12 @@
"ms": "2.1.2" "ms": "2.1.2"
} }
}, },
"ini": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.6.tgz",
"integrity": "sha512-IZUoxEjNjubzrmvzZU4lKP7OnYmX72XRl3sqkfJhBKweKi5rnGi5+IUdlj/H1M+Ip5JQ1WzaDMOBRY90Ajc5jg==",
"dev": true
},
"resolve": { "resolve": {
"version": "1.18.1", "version": "1.18.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz",
@ -1661,30 +1705,66 @@
} }
}, },
"@schematics/angular": { "@schematics/angular": {
"version": "11.0.4", "version": "11.0.5",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-11.0.4.tgz", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-11.0.5.tgz",
"integrity": "sha512-LwBD9TIoLy9XqqInJvlN4BHtPyJExyeorNiOp6rXb/wafuDbvZ+9kY9GWZTY1auVo5PNKqErfxr74ydA3FFb9g==", "integrity": "sha512-7p2wweoJYhim8YUy3ih1SrPGqRsa6+aEFbYgo9v4zt7b3tOva8SvkbC2alayK74fclzQ7umqa6xAwvWhy8ORvg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@angular-devkit/core": "11.0.4", "@angular-devkit/core": "11.0.5",
"@angular-devkit/schematics": "11.0.4", "@angular-devkit/schematics": "11.0.5",
"jsonc-parser": "2.3.1" "jsonc-parser": "2.3.1"
},
"dependencies": {
"@angular-devkit/core": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-11.0.5.tgz",
"integrity": "sha512-hwV8fjF8JNPJkiVWw8MNzeIfDo01aD/OAOlC4L5rQnVHn+i2EiU3brSDmFqyeHPPV3h/QjuBkS3tkN7gSnVWaQ==",
"dev": true,
"requires": {
"ajv": "6.12.6",
"fast-json-stable-stringify": "2.1.0",
"magic-string": "0.25.7",
"rxjs": "6.6.3",
"source-map": "0.7.3"
}
}
} }
}, },
"@schematics/update": { "@schematics/update": {
"version": "0.1100.4", "version": "0.1100.5",
"resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.1100.4.tgz", "resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.1100.5.tgz",
"integrity": "sha512-YwFtgxCQQkYC89IC7dfshyGr0roE6bpp5HgpQLdS/AOjHeZKo7/SPdM0W4ddB+Fml1Fo6v4eFG/Ia9oR7qNv1A==", "integrity": "sha512-BYtKKuiWsrlc4FMW3bRyl4tm6lWNMTi8oql/mtkSgH7V5eMmaLDJtM+zDl+qyC/KHPxbHTfoHDapfv1tITSWjA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@angular-devkit/core": "11.0.4", "@angular-devkit/core": "11.0.5",
"@angular-devkit/schematics": "11.0.4", "@angular-devkit/schematics": "11.0.5",
"@yarnpkg/lockfile": "1.1.0", "@yarnpkg/lockfile": "1.1.0",
"ini": "1.3.5", "ini": "1.3.6",
"npm-package-arg": "^8.0.0", "npm-package-arg": "^8.0.0",
"pacote": "9.5.12", "pacote": "9.5.12",
"semver": "7.3.2", "semver": "7.3.2",
"semver-intersect": "1.4.0" "semver-intersect": "1.4.0"
},
"dependencies": {
"@angular-devkit/core": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-11.0.5.tgz",
"integrity": "sha512-hwV8fjF8JNPJkiVWw8MNzeIfDo01aD/OAOlC4L5rQnVHn+i2EiU3brSDmFqyeHPPV3h/QjuBkS3tkN7gSnVWaQ==",
"dev": true,
"requires": {
"ajv": "6.12.6",
"fast-json-stable-stringify": "2.1.0",
"magic-string": "0.25.7",
"rxjs": "6.6.3",
"source-map": "0.7.3"
}
},
"ini": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.6.tgz",
"integrity": "sha512-IZUoxEjNjubzrmvzZU4lKP7OnYmX72XRl3sqkfJhBKweKi5rnGi5+IUdlj/H1M+Ip5JQ1WzaDMOBRY90Ajc5jg==",
"dev": true
}
} }
}, },
"@types/glob": { "@types/glob": {
@ -1764,6 +1844,12 @@
} }
} }
}, },
"@types/xmldom": {
"version": "0.1.30",
"resolved": "https://registry.npmjs.org/@types/xmldom/-/xmldom-0.1.30.tgz",
"integrity": "sha512-edqgAFXMEtVvaBZ3YnhamvmrHjoYpuxETmnb0lbTZmf/dXpAsO9ZKotUO4K2rn2SIZBDFCMOuA7fOe0H6dRZcA==",
"dev": true
},
"@webassemblyjs/ast": { "@webassemblyjs/ast": {
"version": "1.9.0", "version": "1.9.0",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz",
@ -5582,6 +5668,12 @@
"minimalistic-assert": "^1.0.1" "minimalistic-assert": "^1.0.1"
} }
}, },
"he": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
"dev": true
},
"hex-color-regex": { "hex-color-regex": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz",
@ -7699,6 +7791,31 @@
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=",
"dev": true "dev": true
}, },
"ngx-i18nsupport": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/ngx-i18nsupport/-/ngx-i18nsupport-0.17.1.tgz",
"integrity": "sha512-d8OCQs/XYBEI9qvztQyEkd8gEPFEBmyRg8UcriGQV8Ew1ujvrIieHxmX8YpDpFZKQ4ePextQGUSvjpGd2NauEQ==",
"dev": true,
"requires": {
"chalk": "^2.4.1",
"commander": "^2.15.1",
"he": "^1.1.1",
"ngx-i18nsupport-lib": "^1.10.2",
"request": "^2.85.0",
"rxjs": "^6.0.0"
}
},
"ngx-i18nsupport-lib": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/ngx-i18nsupport-lib/-/ngx-i18nsupport-lib-1.10.2.tgz",
"integrity": "sha512-Z81I2/HUtZ/7X7C3sioJj/Zr/M0iQs0aR5EhYsrWTzdEy7fZWFVYabzzZs+8h6lhQ/4yIl+3sVOCBkI9BiUUEQ==",
"dev": true,
"requires": {
"@types/xmldom": "^0.1.29",
"tokenizr": "^1.3.4",
"xmldom": "^0.1.27"
}
},
"nice-try": { "nice-try": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
@ -11925,6 +12042,12 @@
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==",
"dev": true "dev": true
}, },
"tokenizr": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/tokenizr/-/tokenizr-1.6.3.tgz",
"integrity": "sha512-olHKQV2YP1bpBfPJ7JQUzLWMFC3Dj51bz75TDVoF2rKMPbsx0amtAKus+6y7Cn3TgnpwvjI/4hq97iBJ/4I9MQ==",
"dev": true
},
"tough-cookie": { "tough-cookie": {
"version": "2.5.0", "version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
@ -13534,6 +13657,12 @@
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
"dev": true "dev": true
}, },
"xmldom": {
"version": "0.1.31",
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz",
"integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==",
"dev": true
},
"xmlhttprequest-ssl": { "xmlhttprequest-ssl": {
"version": "1.5.5", "version": "1.5.5",
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",

View File

@ -7,7 +7,8 @@
"build": "ng build", "build": "ng build",
"test": "ng test", "test": "ng test",
"lint": "ng lint", "lint": "ng lint",
"e2e": "ng e2e" "e2e": "ng e2e",
"i18n": "ng extract-i18n --out-file src/locale/messages.xlf && xliffmerge -p xliffmerge.dev.json de"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
@ -26,7 +27,7 @@
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.1100.4", "@angular-devkit/build-angular": "~0.1100.4",
"@angular/cli": "~11.0.4", "@angular/cli": "^11.0.5",
"@angular/compiler-cli": "~11.0.4", "@angular/compiler-cli": "~11.0.4",
"@angular/localize": "^11.0.4", "@angular/localize": "^11.0.4",
"@types/jasmine": "~3.6.0", "@types/jasmine": "~3.6.0",
@ -39,6 +40,7 @@
"karma-coverage": "~2.0.3", "karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0", "karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0", "karma-jasmine-html-reporter": "^1.5.0",
"ngx-i18nsupport": "^0.17.1",
"protractor": "~7.0.0", "protractor": "~7.0.0",
"ts-node": "~8.3.0", "ts-node": "~8.3.0",
"tslint": "~6.1.0", "tslint": "~6.1.0",

View File

@ -3,11 +3,11 @@
<table [ngClass]="['table', 'is-striped', 'is-hoverable', 'is-fullwidth']"> <table [ngClass]="['table', 'is-striped', 'is-hoverable', 'is-fullwidth']">
<thead> <thead>
<tr> <tr>
<th>Id</th> <th i18n="@@app.peopleIndex.table.id.header">Id</th>
<th>First name</th> <th i18n="@@app.peopleIndex.table.firstName.header">First name</th>
<th>Last name</th> <th i18n="@@app.peopleIndex.table.lastName.header">Last name</th>
<th>Email</th> <th i18n="@@app.peopleIndex.table.email.header">Email</th>
<th>Status</th> <th i18n="@@app.peopleIndex.table.status.header">Status</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en-US" datatype="plaintext" original="ng2.template"> <file source-language="en-US" datatype="plaintext" original="ng2.template">
<body> <body>
@ -49,6 +49,41 @@
<context context-type="sourcefile">src/app/app.component.html</context> <context context-type="sourcefile">src/app/app.component.html</context>
<context context-type="linenumber">47,48</context> <context context-type="linenumber">47,48</context>
</context-group> </context-group>
</trans-unit><trans-unit id="app.peopleIndex.table.id.header" datatype="html">
<source>Id</source>
<target>Id</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/people-module/people-index/people-index.component.html</context>
<context context-type="linenumber">6</context>
</context-group>
</trans-unit><trans-unit id="app.peopleIndex.table.firstName.header" datatype="html">
<source>First name</source>
<target>Name</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/people-module/people-index/people-index.component.html</context>
<context context-type="linenumber">7</context>
</context-group>
</trans-unit><trans-unit id="app.peopleIndex.table.lastName.header" datatype="html">
<source>Last name</source>
<target>Familienname</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/people-module/people-index/people-index.component.html</context>
<context context-type="linenumber">8</context>
</context-group>
</trans-unit><trans-unit id="app.peopleIndex.table.email.header" datatype="html">
<source>Email</source>
<target>E-mail</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/people-module/people-index/people-index.component.html</context>
<context context-type="linenumber">9</context>
</context-group>
</trans-unit><trans-unit id="app.peopleIndex.table.status.header" datatype="html">
<source>Status</source>
<target>Zustand</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/people-module/people-index/people-index.component.html</context>
<context context-type="linenumber">10</context>
</context-group>
</trans-unit> </trans-unit>
</body> </body>
</file> </file>

View File

@ -0,0 +1,12 @@
{
"xliffmergeOptions": {
"srcDir": "src/locale",
"genDir": "src/locale",
"i18nFile": "messages.xlf",
"i18nBaseFile": "messages",
"i18nFormat": "xlf",
"encoding": "UTF-8",
"defaultLanguage": "en",
"languages": ["en", "de"]
}
}