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
92
votes
2 answers

Missing locale data for the locale "XXX" with angular

I currently define "LOCALE_ID" on "en-US" this way: @NgModule({ providers: [{ provide: LOCALE_ID, useValue: "en-US" }, ...], imports: [...], bootstrap: [...] }) and it works pretty well. However, in order to test how dates look like in…
ssougnez
  • 5,315
  • 11
  • 46
  • 79
47
votes
3 answers

Angular 5 internationalization

I'm building an application using the latest Angular5 and what I need is for a user to be able to switch languages. I've never had to implement this in an Angular2+ (actually I'm using Angular5). I need to set translations in two…
Rob
  • 6,819
  • 17
  • 71
  • 131
35
votes
4 answers

Angular 6 - i18n vs. ngx-translate

I am working on a large project using angular 6. This project needs significant i18n integration. I am trying to make the right decision as to how to proceed. The way I see it is that I can choose between: ngx-translate…
Joey Gough
  • 2,753
  • 2
  • 21
  • 42
27
votes
2 answers

How to serve different Angular locales during development using ng serve?

I'm developing an app in two different languages (fa/en) using Angular Internationalization (i18n). The target is to deploy the two different builds into sub-folders on the server (example.com/en/...) These builds are different not only in…
azerafati
  • 18,215
  • 7
  • 67
  • 72
23
votes
4 answers

Updates to i18n translation files in Angular

I am currently in the process of adding en locale to an Angular App we are using at my company. After some thinking we decided to go with the Angular 5+ native i18n support. From how I understand it however, everytime the translation file is…
seBaka28
  • 932
  • 1
  • 7
  • 16
20
votes
1 answer

Angular translate innerHTML with params

I would like to translate a source text containing tag with url param, the string text example: STRING_TEXT = 'some text some link name' I know there it is possible to translate
mtx
  • 1,196
  • 2
  • 17
  • 41
18
votes
2 answers

How to use angular 9 $localize with plurals?

Since Angular 9 we can use $localize`Hello ${name}:name:` For i18n in typescript code. This still has some limitations as the ng xi18n command does not detect the strings, but if these texts are added manually to the translation file it works. The…
yankee
  • 38,872
  • 15
  • 103
  • 162
14
votes
5 answers

Prevent Angular from updating base href with langcode

I have problem with angular v9. I have implemented i18n localization features into my app. When I try to build my application with certain location it constantly adds the sub-folder to the base href path (but I want to keep files in the sub-folder).…
Gumowy Kaczak
  • 1,457
  • 2
  • 16
  • 28
14
votes
2 answers

Angular 6: i18n: How to update an existing .xlf file that has already been translated?

In Angular 6, now that I think I comprehend how to make the i18n files and utilize them (e.g. https://angular.io/guide/i18n), I am wondering about maintenance of said files. If I go in and change the html, as I understand it, I would have to…
MapLion
  • 1,041
  • 1
  • 12
  • 38
14
votes
2 answers

Get the value of --locale on runtime for an AOT compiled Angular App

I have an multilanguale app which is compiled with --aot in each language, for instance for German: ng build --aot --env=prod --prod --build-optimizer --i18nFile=src/locale/DARI_messages_de_DE.xlf --i18nFormat=xlf --locale=de --missingTranslation…
Thomas
  • 1,058
  • 8
  • 15
12
votes
4 answers

How do I 'ng serve' the original app after localizing it with @angular/localize?

I was playing with Angular's localization @angular/localize and after configuring it to translate the app to different language I tried to serve the default version of it using 'ng serve' but I get this error: An unhandled exception occurred: The…
Theraggon
  • 123
  • 1
  • 7
12
votes
3 answers

How to enable installation of the multi language Angular PWA with single service worker?

I have prepared applications with localized language versions. For this purpose I used the native Angular i18n module, which prepared two application packages with the appropriate language in each. Each version of the application is available under…
12
votes
5 answers

Angular: How to display a date in French format

I am an Angular beginner, I read the documentation of Angular, and it's hard for such an elementary thing... I want that the dates and other things in my application have the French locale, and not the default 'en-US'... I started to read this…
serge
  • 13,940
  • 35
  • 121
  • 205
12
votes
2 answers

angular-i18n Angular 6 Internationalisation : How to deal with variables

I've read the entire doc here : https://angular.io/guide/i18n I can't make heads or tails of how I'm supposed to handle a html tag of this nature :
{{currentPage}}
or one like this :
tatsu
  • 2,316
  • 7
  • 43
  • 87
11
votes
1 answer

Angular 10 - register custom locale

Due to Angular update, I have problem with locales. For now: import localePl from '@angular/common/locales/pl'; registerLocaleData(localePl); It's working but causes an error: WARNING in app.module.ts depends on…
Thomas Banderas
  • 1,681
  • 1
  • 21
  • 43
1
2 3
17 18