Questions tagged [angular-i18n]

angular-i18n is part of the Angular framework, which provides i18n features like localization (dates, number, percentages, and currencies), text translations, pluralization and alternative text. For the older AngularJS (1.x) web framework, use the angular-translate tag.

Angular 2+ provides its own tool for internationalization. It already supports many features, but misses some major features like lazy loading, translation outside templates etc. Those features will be available in Angular 6+.

Angular i18n Documentation

Since Angular is under development the implementation of i18n still is in progress an can be tracked on this GitHub issue: #16477

263 questions
4
votes
0 answers

Angular 5 i18n with JIT - Lazy Loading Language files

We're using Angular 5 with JIT and would like to replace the XLF content used for translations in the app, depending on a query string value. Not having a specific culture specified in the boot.browser.ts leads to all xlf files to be bundled into…
4
votes
2 answers

set directional-scss variable at build time

i'm using angular to build multi language system, with angular i18n for internalization I have to build each language as a different package. Since some of the languages are RTL, i'm using directional scss (instead of importing different stylesheets…
Shaniqwa
  • 1,924
  • 2
  • 17
  • 29
4
votes
3 answers

Angular 2 i18n message with HTML tag inside

Im trying to translate my app using the i18n official implementation of angular 2: https://angular.io/guide/i18n and im trying to translate some message with HTML inside (font awesome icons lets say). For example this:
3
votes
0 answers

Using Angular built-in i18n with Capacitor

Now we have an application which uses Angular built-in i18n for multi-lingual app and with using Angular built-in i18n there is a separate build for each language. We will use Capacitor as a hybrid mobile solution, but Capacitor copy the application…
3
votes
1 answer

Angular Internationalization Interpolated Strings

I am not sure how to do a translation for a dynamic variable in my app. Currently, I have the report descriptions in a static json file. I am looping through the content of that and using string interpolation in the HTML file. Is there a way to…
gby
  • 121
  • 8
3
votes
1 answer

Firebase i18n rewrite language-override cookie is ignored

I localized an Angular App with the standard Angular localize package. That works perfect and I host my app on firebase. I read the firebase article on how to configure i18n rewrites and implemented it in my…
3
votes
1 answer

Angular $localize is not a function

I've got a strange error trying to use $localize in my ts files. I am getting this error Error: Uncaught (in promise): TypeError: _angular_localize_init__WEBPACK_IMPORTED_MODULE_3__.$localize is not a function TypeError:…
Real World
  • 1,593
  • 1
  • 21
  • 46
3
votes
2 answers

How pass a variable using $localize

I am using i18n to translate my Angular 2 application. I need to send a variable to a translation unit from ts. I have the following trans-unit: In
juanjinario
  • 596
  • 1
  • 9
  • 24
3
votes
1 answer

Change angular base href when ng build --prod --localize

The situation I have created an Angular App with Internationalization (i18n). I want to host the different versions in subdomains like: en.myexample.com es.myexample.com The problem When I use the command ng build --prod --localize the tag base…
amc software
  • 747
  • 1
  • 7
  • 18
3
votes
1 answer

An unhandled exception occurred: Missing required element

I am getting an error with my i18n file in Angular 9: An unhandled exception occurred: Missing required element Here is the start of my messages.xlf file:
Kevin192291
  • 1,925
  • 4
  • 26
  • 43
3
votes
1 answer

how to test multi language with angular 9

Up to angular 8 I was used to use --base-href /en/ --i18n-file=src/locale/messages.en.xlf --i18n-format=xlf --i18n-locale=en for example to generate one application per language. This approach or the i18n-options are now depreciated. In version 9…
Myonara
  • 1,197
  • 1
  • 14
  • 33
3
votes
3 answers

Angular client-side language switching

Background We are developing an app with Angular 8.2. This question is not related to AngularJs. Problem I have read the Angular localization document here: https://angular.io/guide/i18n But it seems that localization was done in the building…
3
votes
1 answer

Angular 8 i18n translate dynamic variable

I have in my app.component.html an element that is on every page:

{{title}}

I have a shared service that has a setters and getters: ... title = new BehaviorSubject('Initial Title'); setTitle(title: string)…
Juliano
  • 141
  • 1
  • 11
3
votes
1 answer

Angular CLI 8 update - URLs not prefixed with base href anymore

Problem After updating our Angular application to version 8 (including Angular CLI), URLs are not prefixed with the base href provided in the angular.json file anymore, which essentially breaks our application Previous, desired behaviour When…
tuomasi
  • 41
  • 7
3
votes
1 answer

How to have xliffmerge work with angular 8?

As written in the doc, I have installed tooling from @ngx-i18nsupport: setup everything and in may package.json file the following script: "extract-i18n": "ng xi18n IOCheck --i18n-format xlf --output-path i18n --i18n-locale fr && xliffmerge" when…
Philippe Corrèges
  • 663
  • 1
  • 11
  • 31