angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.74k stars 11.98k forks source link

Error when parsing xlf2 file for translation #7278

Closed alkuma closed 5 years ago

alkuma commented 7 years ago

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

angular-cli: 1.0.0-beta.28.3 node: 6.9.1 os: linux x64

Repro steps.

Created the xlf2 file for the project using the command ng-xi18n --i18nFormat=xlf2 --outFile=app/locale/messages.xliff2.xlf Next, performed the translation to create app/locale/messages.ts-TH.xliff2.xlf to create translation created i18n-providers.ts (attached) i18n-providers.ts.txt

modified main.ts (attached) to get translation providers before bootstrap. Upon running the application (via chrome) application fails to boot with the following error in console log main.ts.txt

The log given by the failure.

console.log.txt

Desired functionality.

There seems to be some issue with how the xlf2 file is being parsed. This is a bug that needs to be fixed. If any workaround is possible, please suggest.

Mention any other details that might be useful.

Instructions followed were from: https://angular.io/guide/i18n https://stackoverflow.com/a/43369141/41284 - used rxjs instead of systemjs locale value is hardcoded to ts-TH in the index.html to simulate this issue also noticed a similar issue https://github.com/angular/angular-cli/issues/6418 but raising this since the way we simulated the issue was slightly different so it could be a different root cause

alkuma commented 7 years ago

If anyone could point to the code that parses the xlf2 file I could attempt to submit a patch myself

Brocco commented 7 years ago

The first thing I would suggest is to update your version of the CLI. The latest version as of today is 1.3.1 which is much more up to date than the beta you are currently using. Please report back after updating.

ocombe commented 7 years ago

can you give us the content of the file "messages.xliff2.xlf" ? I suspect that there is a missing closing tag or quote in your translations

alan-agius4 commented 5 years ago

Closing as no further feedback was provided.

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.