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
0
votes
1 answer

How to mock on a translation I18n in jasmine karma?

So I try to do some unit testing on component level with Jasmine karma. And I am using this translatioin class: I18n And I have this component: constructor( private qrCodeService: QRCodeDefinitionService, private i18n: I18n, private…
user12296049
0
votes
0 answers

Angular translate core - updating the translations from http request

I've added the @ngx-translate/core, inside a http-request I get dropdown values. Those values are then added to a translation language object using the method: translate.setTranslation('en', { HELLO: 'hello {{value}}' }); Is there any way to…
alphapilgrim
  • 3,761
  • 8
  • 29
  • 58
0
votes
0 answers

Angular 8: Error when trying to generate translation files

I'm in the process of developing my first translatable Angular 8 app using the new i18n module. I have already added translation keys everywhere in my application's templates using either the i18n or i18n-placeholder attributes. However, when I try…
Tobias Timpe
  • 720
  • 2
  • 13
  • 27
0
votes
1 answer

How to internationalize innerHtml using build-in angular i18n

So I'm in a project to internationalize a web using build-in angular i18n. But apparently in their code they use innerHtml to show a warning and I can't seem to find a way to internationalize this in the official documentation. The html get the…
Elenora
  • 1
  • 4
0
votes
1 answer

dynamic var in i18n message

i have an angular 7 project with multi languages and i have also the validation messages translated in the i18n files so i am facing a problem with the length validation message which should be "this field must be less than xxx characters" as…
0
votes
1 answer

Generating i18n translation file for multicomponent Angular application

I have an application developed with several components (.ts and .html). When I try to generate Xlif translation file with ng xi18n, only one component seems to be scanned, and translation sources for all other components are not in the xlif…
0
votes
1 answer

How can I add i18n in an input plaeholder?

I have some inputs with placeholders. like that: But, I have to respect the i18n method. i18n-placeholder is not allowed with Angular 6 What is the right way?
A.Sana
  • 95
  • 2
  • 14
0
votes
1 answer

Angular i18n binding

How would I achieve translating a binding using Angular built-in i18n? //this works fine //but what if it's a binding???
Wildhammer
  • 2,017
  • 1
  • 27
  • 33
0
votes
0 answers

i18n translate dynamic text with spacing

I'm not able to translate dynamic text with spacing, see example below. sample.ts dynamicTexts = ['Date','Hello World'] sample.html {dynamicText, select, other { {{ dynamicText }}…
nicker
  • 477
  • 2
  • 6
  • 20
0
votes
1 answer

use Angular dateformat but not in pipe

I want to use the function formatDate wich is used by datePipe of Angular the function is in: angular/packages/common/src/i18n/format_date.ts when i try to import it: import {format_date} from '@angular/common/src/i18n/format_date' I get an…
Slimane MEHARZI
  • 334
  • 5
  • 11
0
votes
1 answer

Angular mat-icon is being "translated"?

Summary: I am using the "+" sign material icon on a page to represent adding a new item. On the English version of the site, it displays fine. On the Spanish version of the site, it displays "ñ" Question: Should I not have any text in between the…
0
votes
1 answer

Can't combine select and plural in ngx-translate-messageformat-compiler

I am using ngx-translate-messageformat-compiler in my Angular app. I have a component property initialised in ngOnInit: this.translations = { count: this.selections.length, status: this.toStatus }; and in my lookup strings, I have things like…
Ben Taliadoros
  • 7,003
  • 15
  • 60
  • 97
0
votes
1 answer

How should I use i18n translate in this situation?(Translate text with variables)

I'm working with Angular 7. I need to translate texts with variables. Let's say I want to translate it to German. The words(variables) needs to change positions because of the language properties. Example: EN: Logged in as Robert. DE: Als Robert…
0
votes
0 answers

i18n translation is throwing error for Angular 4 - attribute

I am using angular for my project. I have following in my XLF translation (messages.fr.xlf) Social Insurance Number Numéro d’assurance sociale Use this as…
Hitesh
  • 512
  • 6
  • 24
0
votes
1 answer

using angular-dynamic locale webpack

How to use the angular-dynamic-locale with webpack? The angular-dynamic-locale always tries to load the angular-locale_en.js file from path http://localhost:8080/angular/i18n/angular-locale_de.js during the running-time, when the…
matyig
  • 454
  • 5
  • 15