Questions tagged [angular-localize]

46 questions
15
votes
5 answers

How can I localize my Angular 11 library?

I'm refactoring my Angular 11 application into libraries. My regular application is localized using @angular/localize as a dev dependency, so I have made use of the $localize directive in part of my code. I need to move this code with this directive…
Roddy of the Frozen Peas
  • 14,380
  • 9
  • 49
  • 99
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
7
votes
2 answers

How to handle angular 11 extract-i18n overriding existing translations?

So i have a angular 11 application where i just implemented localization with angulars default i18n middleware. To create an initial file i just ran : ng extract-i18n myprojectName --format xlf --output-path src/i18n --out-file messages.da.xlf…
Timsen
  • 4,066
  • 10
  • 59
  • 117
4
votes
4 answers

is runtime language translation possible with angular (@angular/localize)?

I am trying to learn and add angular internationalization in a project. I can understand only compile time translation from angular documents (https://angular.io/guide/i18n-overview). I need some thing like this…
3
votes
2 answers

Angular i18n with em and strong?

I'm preparing an application for internationalization with the @angular/localize library, so I'm going through and adding i18n attributes to fields that contain copy. I've run into some difficulty where I have paragraphs of text that contain em and…
Roddy of the Frozen Peas
  • 14,380
  • 9
  • 49
  • 99
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
0 answers

How can I use localized assets with angular localize

I would like to use Angular localize (@angular/localize) in one of my Angular projects. Translating texts into different languages was straightforward with the help of the documentation. However, I also have a few localized images, and I can't…
3
votes
3 answers

Angular 10.2 build: Localized bundle generation failed: Cannot read property 'value' of undefined

I have a project build on Angular 10.0.11. I updated the project to 10.2 with npm update, but this resulted in multiple Unable to fully load [...] for source-map flattening: Circular source file mapping dependency -errors, when trying to build I…
Jette
  • 2,459
  • 28
  • 37
2
votes
1 answer

NX Monorepo (14.3.6) no support for $localize (Angular localize)

Here is the case I have installed latest version of nx monorepo (npx create-nx-workspace@latest). Currently latest version of nx is (14.3.6). After this I have added angular localization package (npm install @angular/localize). At this point now…
Hivaga
  • 3,738
  • 4
  • 23
  • 36
2
votes
0 answers

Angular i18n not supporting all locales in angular.json

My angular application I want to support languages french(Canada), french(France) and US english. This is my angular.json file i18n code. "i18n": { "sourceLocale": "en", "locales": { "fr-CA":…
Rajesh
  • 2,472
  • 3
  • 25
  • 31
2
votes
1 answer

How to escape curly braces in Angular's $localize function?

If i try to translate the following text: {example} like this: $localize`{example}` The text will disappear in the translated build. Is there a way to escape the curly braces?
Martijn van den Bergh
  • 1,434
  • 1
  • 20
  • 40
2
votes
0 answers

How to create a common assets folder for multiple locale in angular

I am localizing my angular app for 2 languages by following the official guide. During production build, I get one folder for each locale and each folder has its own assets folder. This has a couple of issues My images don't get served at dev and…
Dejazmach
  • 742
  • 8
  • 15
2
votes
0 answers

Angular 12 localized with @angular/localize run in docker with nginx

I have set up a project with angular 12 and use localization in it. I can successfully run english version of my site, but when I switch to other locales via button which changes url to be localhost/de server responds with many 404 for different…
Victor Orlyk
  • 1,454
  • 2
  • 15
  • 27
2
votes
0 answers

npm build fails when using with Docker and Angular localize

I am working on a relatively large project that I aim to localize. I have done everything necessary and I'm not in the process of extending the existing Docker file to enable this. However, it fails. This is the Docker File (at least to the part…
Schottky
  • 1,549
  • 1
  • 4
  • 19
2
votes
0 answers

Angular Decimal Pipe locale dependend on browser

I am using a DecimalPipe in my Angular application to display numbers, but the problem is that the default locale for the decimal pipe is 'en-us'. Thus the number one million is formatted as 1,000,000. I however am a European and I want it to be 1…
1
2 3 4