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
0
votes
0 answers

angular 2 setTranslation in ngx-translate 7.0.x

I am using ngx-translate method setTranslate to merge the new_lang.json file into my lang.json file at runtime with some condition. I am passing 3rd Parameter of method as true (shouldMerge). new_lang.json file has the same json object keys as…
Himanshu
  • 1
  • 2
0
votes
2 answers

NGX-Translate on Angular 4, ERROR ON "return new TranslateHttpLoader(http, './assets/i18n/', '.json');"

I have looked for answers over Google and Stackoverflow, but didn't find a solution. I followed instructions from the website My steps: 1) Created an Angular 4 project using ng new NGXTest. 2)Inside the project folder, executed: npm install…
URKA
  • 1
  • 3
0
votes
1 answer

ionic 3 action sheet title translation

i am using action sheet and ngx translate plugin in my ionic 3 angular app. like everywhere else in my app the translation for action sheet doesn't work if i specify like below then whole of it is considered as string. this.actionSheet =…
Vik
  • 8,721
  • 27
  • 83
  • 168
0
votes
1 answer

Translate service dynamically Ionic 2 Angular 2 ngx-translate

I am building an app with ionic 2 and I would like to translate some objects from the server response without storing it in a JSON file. I´m using ngx-translate For example, i am receiving an object like this: { "name": ["Hello", "Hola", "Bon…
0
votes
1 answer

can ngx-restangular and @ngx-translate/core work together?

I'm trying to use both ngx-restangular 1.0.11 & @ngx-translate 7.0.0 in the same project. However, I can only ever get one of them to work at a time. I put log statements in each Factory that's called during import and only one of them ever gets…
Sherri M
  • 142
  • 4
  • 10
0
votes
1 answer

Pass translated value using ngx-translate in Ionic

I am trying to find a way to pass a translated value using ngx-translate in Ionic (I want to do it in ion-card). Of course I can display the value like:

{{ 'DATA' | translate }}

But how do I pass the result as a parameter? I…
AKH_coder
  • 25
  • 6
0
votes
1 answer

Use ngx-translate in Ionic 2 : how to add downloaded external languages files ? dynamically change folder of json or use setTranslate?

I use nxg-translate in Ionic 2 project. in my app.module.ts, i use translateHttpLoader : ... imports: [ BrowserModule, HttpModule, IonicImageViewerModule, IonicModule.forRoot(MyApp, AppOptions), IonicAudioModule.forRoot(), …
David Anquetin
  • 151
  • 1
  • 9
0
votes
1 answer

Wait for global user object before initializing other modules

I have a method load() which is ran in a global authorization service that gets a user object from the server. This method is run with APP_INITIALIZER. The method looks as follows: load(): Promise { return this.http.get(API_ENDPOINT +…
merlino
  • 273
  • 1
  • 3
  • 8
0
votes
1 answer

Ngx-translate with Angular Universal

I just upgraded from ng2-translate (v. 5.x.x) to ngx-translate (v. 6.x.x) in my Angular 2 Universal App. Before the upgrade I was using this loader (found here): class TranslateUniversalLoader implements TranslateLoader { public…
don
  • 4,113
  • 13
  • 45
  • 70
-1
votes
2 answers

Angular Translation Service

I would like to translate wordings from eng to chinese using a key-value mapping approach with angular translation service but i failed. Any ideas?? mapping json: "At most {{ number }} wrods":"最多輸入{{ number }}字": In typescript: import {…
apple
  • 9
  • 3
-1
votes
1 answer

how to change labels for example en to english using ngx-translate

I'm using ngx-translate in project. I have created files en.json and it.json inside assets/i18n In component language I write this code: ngOnInit(): void { this.translate.addLangs([ 'it', 'en' ]); …
-1
votes
1 answer

Use ngx-translate with array as interpolate parameters

I am using the instant method from ngx-translate to translate some messages into the language of the user. These messages are passed as JSON to ngx-translate. Some of the messages take dynamic values: { "message.key": "First value is {{0}} and…
stm
  • 174
  • 1
  • 2
  • 11
-1
votes
1 answer

ngx-translate-multi-http-loader : Something went wrong for the following translation file

I was using this library ngx-translate-multi-http-loader to being able to load multiple language file for my ionic 5 App. I didn't had any errors, but the translation wasn't working. Then I added inside the TranslateModule.forRoot({}) the…
-1
votes
1 answer

angular - How can I translate a text inputted by user (not specified during the development process)

I am working on a website allows the user to input objects contain texts, and those texts must be translated when the website's language changed. I have read about i18n and ngx-translate but both of them work with hard coded texts.
-1
votes
1 answer

ngx-translate does not show translated text

i'm using @ngx-translate/core@12.1.2 and i have configured the app like this, app.module.ts ... TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: HttpLoaderFactory, deps: [HttpClient] } …
pl-jay
  • 970
  • 1
  • 16
  • 33
1 2 3
47
48