Moris
Moris

Reputation: 135

Angular i18n Translation outside template and more

I have a few questions about i18n implementation. After searching across documentation and across all the web, there are still some open issues for me.

  1. Can I use a translate service from i18n to localize strings outside of templates? (aka ts files)
    In AngularJs there was $translate service for that purpose.
  2. Is it possible to use i18n both JIT and AOT? it will be great to localize the static strings and let the dynamic ones to get translated on build time.
  3. I already implemented localization with ngx-translate. Did someone use both ngx-translate and i18n in its projects?

Thanks in advance for your answers!

Upvotes: 2

Views: 713

Answers (1)

Anshita Singh
Anshita Singh

Reputation: 1884

As per my knowledge,

Answer 1. yes we can use translate service from i18n to translate .ts files string but this is available from v9. Till version 8 .ts file translation is not present i suppose. Following link for support: angular-localize

Answer 2. Yes, we can use i18n in both JIT and AOT mode. In AOT mode you are already creating application bundle per locale and as per user changes, you will load respective bundle. And in JIT mode you have to re-bootstrap the complete application after translating as per user choose locale.

Upvotes: 1

Related Questions