2

Is there a tool for localization in Angular 2 when using Angular-cli?

I ran into this link (from November) stating that "right now, you can’t use the CLI in translated applications" so the i18n tool can't be used in my application.

Is there another way to translate the application to different languages?

(I'm using webpack, not systemJs)

5

1 Answer 1

2

There is a story in the Angular CLI wiki which should help you:

https://github.com/angular/angular-cli/wiki/stories-internationalization

From that article:

When your app is ready, you can extract the strings to translate from your templates with the ng xi18n command.

ng xi18n --output-path src/locale

Once you've translated you can serve:

ng serve --aot --locale fr --i18n-format xlf --i18n-file src/locale/messages.fr.xlf

Or build:

ng build --aot --locale fr --i18n-format xlf --i18n-file src/i18n/messages.fr.xlf
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.