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

Property 'VAR_PLURAL' does not exist on type

Using angular 8.x i18n I've come across an issue with a very obscure error message (as all i18n error messages tend to be; looking at you, https://github.com/angular/angular-cli/issues/7555#issuecomment-394228634). The message states: ERROR in…
crollywood
  • 523
  • 1
  • 6
  • 17
3
votes
5 answers

Angular8 : ng run => 'Project target does not exist.' when using i18n

Based on those tutorials : https://angular-templates.io/tutorials/about/angular-internationalization-i18n-multi-language-appand…
phenric
  • 307
  • 1
  • 8
  • 15
3
votes
1 answer

Localization using i18n in angular 7 is not working after deployment to Azure

I'm following this link to implement localization in Angular using i18n. When i navigate to "url/en" or "url/fr", instead of pointing to respective directory folders it is trying to search for a route and giving the below error…
3
votes
1 answer

Angular i18n for attributes with select

I have an element I want to translate using i18n from angular. The part that I want to translate is the matTooltip but the value is a select. I know that I have to use i18n-matTooltip to make it work. I should use this syntax The author…
3
votes
1 answer

Angular i18n - Error: Could not mark an element as translatable inside a translatable section

In my Angular 7 application, I have an html with nested tags like this -

Some Text Here Link Text Another Text Here

When executing…
Yogesh Patel
  • 95
  • 2
  • 13
3
votes
1 answer

i18n multi-direction RTL angular

i am using angular 4 and i am trying to implement the technique of i18n into my app, the problem is: i don't know where should i write the direction LTR/RTL in the file of the translation messages.ar.xlf , even when i mention it in every tag in my…
Mohamed Hassona
  • 308
  • 4
  • 16
3
votes
0 answers

ng2 i18n: use NOT english as a default language in templates

I'm developing app for russian speaking people. English locale is 'backup'. So i'd like to see russian words in my templates to make it easier to understand. It works fine, but injected LOCALE_ID is always 'en-US' if I don't provide in in module…
Katya Pavlenko
  • 3,303
  • 3
  • 16
  • 28
3
votes
1 answer

Angular 2+ i18n dialects/accents

Let's say we set up and use the Angular i18n-tags similar to the documentation:
Hello World
We generate our translations using ng xi18n --i18nFormat=xlf So far so good, now we want to start generating specific translations for…
3
votes
1 answer

Angular 6 Internationalization i18n - lot of efforts to keep it updated

I am working with Angular 6 i18n. I am working with multi-language, meaning that I followed cookbook: https://v2.angular.io/docs/ts/latest/cookbook/i18n.html#!#ng-xi18n My current implementation is using AOT, so I generated a messages.xlf file and a…
3
votes
0 answers

Testing angular i18n - how to provide the i18nLocale to test

Using angular-i18n and trying to unit test with CLI ('ng test') but don't know how to set the i18nLocale for the test's build as I am doing with a designated build configuration for 'ng build'. Alternatively if I can set this in runtime that would…
3
votes
0 answers

How to maintain state when switching locale in an Angular-i18n AOT SPA?

I'm attempting to build a multi-language SPA using Angular-i18n, XLIFF files and AOT. I've read the Angular guide as well as eg. the Stackoverflow post Angular 5 internationalization , and understand that the i18n process will result in separate…
Simon
  • 2,994
  • 3
  • 28
  • 37
3
votes
1 answer

ngx-translate : How to provide context for translations in html and ts files?

I am using ngx-translate to support I18N in my angular 5 application. I wanted to know how i can specify the context for the word /sentence getting translated? Example code from HTML: {{title |…
user2439903
  • 1,277
  • 2
  • 34
  • 68
3
votes
1 answer

Universal i18n server-side

I'm trying to use Universal with i18n. I'm already building the app and setting the server config so that once the app passes to browser-side mode the user is redirected to the correct translation of the app, that is fine. The issue I'm having is…
Kunepro
  • 418
  • 2
  • 4
  • 18
3
votes
0 answers

Setting up custom locale ID Angular (currently ^5.2.0) applications

I am trying to use locale ID "no-no" while serving building my app as following: ng serve --aot --locale no-no But it reports error as following: Unable to load the locale data file "@angular/common/locales/no-no", please check that "no-no" is a…
3
votes
3 answers

Internationalization of dynamic content in Angular?

Angular.io describes the i18n tag as follows: The Angular i18n attribute marks translatable content. Place it on every element tag whose fixed text is to be translated. So my question is this. What if I have an element whose content is dynamic?…