Skip to content

Commit

Permalink
Merge pull request #23 from martinroob/milestone-0.5
Browse files Browse the repository at this point in the history
Milestone 0.5
  • Loading branch information
martinroob committed May 5, 2017
2 parents 6e453e7 + 1cbfb1c commit 24d75d2
Show file tree
Hide file tree
Showing 11 changed files with 1,076 additions and 16 deletions.
9 changes: 8 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<a name="0.4-0"></a>
<a name="0.5.0"></a>
# [0.5.0](https://github.com/martinroob/ngx-i18nsupport/compare/v0.4.0...v0.5.0) (2017-05-05)

### Features

* **xliffmerge:** added XLIFF 2.0 support. ([#20](https://github.com/martinroob/ngx-i18nsupport/issues/20))

<a name="0.4.0"></a>
# [0.4.0](https://github.com/martinroob/ngx-i18nsupport/compare/v0.3.1...v0.4.0) (2017-05-03)

### Bug Fixes
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ It is described in the official documentation Angular Cookbook [Internationaliza

Said in one sentence,
* markup your strings to translate in your templates with an attribute `i18n`
* run the Amgular extraction tool (`ng-xi18n`) to extract the strings in an XML Format called [[XLIFF]]((http://docs.oasis-open.org/xliff/xliff-core/xliff-core.html))
* run the Amgular extraction tool (`ng-xi18n`) to extract the strings in an XML Format called [[XLIFF-1.2]](http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html)
* copy and then translate the extracted file for every language you plan to support
* run the ng compiler to generate a special version of your app for the different languages

Expand Down Expand Up @@ -104,8 +104,8 @@ The options are:
- `srcDir` (string, default "."): directory, where the master file is expected
- `genDir` (string, default "."): directory, where files are written to (normally identical with srcDir)
- `i18nFile` (string, default "messages.xlf"): master file (relativ to srcDir)
- `i18nFormat` (string, default "xlf"): "xlf" for XLIFF or "xmb" for XML Message Bundles
- `encoding` (string, default "UTF-8"): expected encoding of xlf or xmb files
- `i18nFormat` (string, default "xlf"): `xlf` for XLIFF 1.2 or `xlf2` for XLIFF 2.0 or `xmb` for XML Message Bundles
- `encoding` (string, default "UTF-8"): expected encoding of xlf, xlf2 or xmb files
- `defaultLanguage` (string, default "en"): the native language used in your templates
- `languages` (array of strings): list of languages (if not spefified at command line)
- `removeUnusedIds` (boolean, default `true`): flag, if unused IDs should be removed during merge
Expand Down Expand Up @@ -201,7 +201,8 @@ But if you are interesting, send me an email, so that we can discuss it.
* Phillippe Martin
[Deploying an i18n Angular app with angular-cli](https://medium.com/@feloy/deploying-an-i18n-angular-app-with-angular-cli-fc788f17e358)
* Roland Oldengarm: [Angular 2: Automated i18n workflow using gulp](http://rolandoldengarm.com/index.php/2016/10/17/angular-2-automated-i18n-workflow-using-gulp/)
* XLIFF Specification: [XLIFF Spec](http://docs.oasis-open.org/xliff/xliff-core/xliff-core.html)
* XLIFF 1.2 Specification: [XLIFF-1.2](http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html)
* XLIFF 2.0 Specification: [XLIFF-2.0](http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html)
* My Tiny Translator Tool: [TinyTranslator](https://github.com/martinroob/tiny-translator)

[travis-badge]: https://travis-ci.org/martinroob/ngx-i18nsupport.svg?branch=master
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-i18nsupport",
"version": "0.4.0",
"version": "0.5.0",
"description": "Some tooling to be used with the Angular 2 i18n workflow",
"main": "index.js",
"module": "./src",
Expand Down Expand Up @@ -49,6 +49,6 @@
"dependencies": {
"chalk": "^1.1.3",
"commander": "^2.9.0",
"ngx-i18nsupport-lib": "^0.0.8"
"ngx-i18nsupport-lib": "^0.1.3"
}
}
8 changes: 4 additions & 4 deletions src/xliffmerge/xliff-merge-parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ export class XliffMergeParameters {
} catch (err) {
this.errorsFound.push(new XliffMergeError('i18nFile "' + this.i18nFile() + '" is not readable'));
}
// i18nFormat must be xlf or xmb
if (!(this.i18nFormat() === 'xlf' || this.i18nFormat() === 'xmb')) {
this.errorsFound.push(new XliffMergeError('i18nFormat "' + this.i18nFormat() + '" invalid, must be "xlf" or "xmb"'));
// i18nFormat must be xlf xlf2 or xmb
if (!(this.i18nFormat() === 'xlf' || this.i18nFormat() === 'xlf2' || this.i18nFormat() === 'xmb')) {
this.errorsFound.push(new XliffMergeError('i18nFormat "' + this.i18nFormat() + '" invalid, must be "xlf" or "xlf2" or "xmb"'));
}
}

Expand Down Expand Up @@ -267,7 +267,7 @@ export class XliffMergeParameters {

/**
* Format of the master xlif file.
* Default is "xlf", possible are "xlf" or "xmb".
* Default is "xlf", possible are "xlf" or "xlf2" or "xmb".
* @return {string}
*/
public i18nFormat(): string {
Expand Down
Loading

0 comments on commit 24d75d2

Please sign in to comment.