Questions tagged [ngx-translate]

NGX-Translate is an internationalization library for Angular 2+. It lets you define translations for your content in different languages and switch between them easily.

Resources:

  1. Website: http://www.ngx-translate.com/
  2. Github: https://github.com/ngx-translate
  3. Demo: https://stackblitz.com/github/ngx-translate/example
716 questions
-1
votes
2 answers

How to use translate pipe in typescript with Angular

I want to display a translated message when a button is clicked so I need to use the translate pipe in the typescript. This is my json : "newRepair": { "intake": { "errormessage" : "This is a required field" } } This is the…
hiba nebli
  • 107
  • 2
  • 18
-1
votes
1 answer

Cors issue on ngx-translate of externally loaded js in Angular project

First a bit of context: we've got an Angular project (call it "project X") that has its own json translation files (loaded with ngx-translate). This project is then ported as Angular Elements (the whole thing is ported to a single js file, call it…
-1
votes
1 answer

How to use truncate with ngx-translate

I am trying to truncate string after it gets translated. I need help on how to use truncate after the string gets translated. < span class="inputName" translate>{{ TIMESLOT_1 | truncate:[4] }} < /span> I've attempted the method above, but that…
-1
votes
1 answer

How to use ngx-translate for date DatePipe?

I have an application that it's running in two language ( i can change an choose the language i want bu using i18n) English / French. At the moment i can get the date only in english even if i select the French Language.
LisaParker
  • 21
  • 3
  • 9
-2
votes
1 answer

Failed: this.translate.get is not a function (unit testing)

I have a unit test in angular and I am getting this error: TypeError: this.translate.get is not a function at TranslatePipe.updateValue…
zen zen
  • 1
  • 1
-2
votes
2 answers

How to wait until translation array loop complete - with subscribe

This is my translation method. getting empty array on console. how to handle this? headersTranslator(headers) { const transHeader: any[] = []; headers.map((header) => { this.translate.get(header.title).subscribe((value) => { …
3gwebtrain
  • 14,640
  • 25
  • 121
  • 247
-2
votes
1 answer

Apply param with the translate service and array of strings

This is from the doc: translate.get('HELLO', {value: 'world'}).subscribe((res: string) => { console.log(res); //=> 'hello world' }); How can I apply with the array like so? setPayPal(): void { …
Sampath
  • 63,341
  • 64
  • 307
  • 441
-2
votes
1 answer

NativeScript with Angular - ngx-translate how to add translations after the application has initialized

I'm writing an application with NativeScript 6.4.1 and Angular 8. I want to use the ngx-translate library in my project: https://github.com/ngx-translate/core Here is my sample repository: https://github.com/aubrey-fowler/translationsTest1 It's…
user1261710
  • 2,539
  • 5
  • 41
  • 72
-2
votes
2 answers

Can ngx-translate be used with database translations?

I have a large database (pouchDB) full of translations each languages translations is held in its own db. How would I use ngx-translate to get the translations directly from the db?
-2
votes
1 answer

ERROR TypeError: Cannot read property 'setDir' of undefined

Hi I'm new to Ionic/Angular and I have a problem and i stack in it more than 20 days. I make small app and i want make it multi language RTL and LTR so i follow the docs here: https://ionicframework.com/docs/theming/rtl-support/ but still have same…
MIB
  • 29
  • 6
-4
votes
1 answer

Translate pipe is not working in child module

I am developing a sample app using Angular 8. Along with ngx-translate for translation. I have imported all the required code in app.module.ts for translate service and it worked perfectly fine. As soon as i added a new module for lazy loading and…
mulla.azzi
  • 2,676
  • 4
  • 18
  • 25
1 2 3
47
48