ngx-translate

ngx-translation issue with ionic 3 app

落爺英雄遲暮 提交于 2019-12-03 20:45:55
ngx translation with ionic 3 app not working for me. below is my code: app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { ErrorHandler, NgModule } from '@angular/core'; import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; import { HttpModule,Http } from '@angular/http'; import { IonicStorageModule } from '@ionic/storage'; import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { MyApp } from './app.component'; import { StatusBar } from '@ionic-native

Use ngx-translate in a multi-module Angular setup and child-libraries

丶灬走出姿态 提交于 2019-12-03 15:50:45
I am using ngx-translate for translation in my Angular app. It works just fine with a simple project setup, but we develop a large-scale business application and different components are split into several seperate libraries. Some of the libraries do need to have some translations and of course translation should change for all parts of the app with a click on the same button. Using angular-librarian for bundling the component libraries I have so far not been succesful to just create one instance of ngx-translate for both the top-level Angular-Cli project and the included angular-librarian

Differences ngx-translate vs i18n

此生再无相见时 提交于 2019-12-03 15:37:14
问题 There are multiple methode to translate an (Angular) app, the big main methodes are : ngx-translate and Angular 2 native i18n As far I understood i18n is easier for SEO because of the clean url browsing with e.g app.com/de app.com/en on the other hand with ngx-translate it is easier to switch between languages. I know that the creator of ngx-translate was hired by Angular for their i18n. Can anybody say me what the main differences are (pro/cons)? 回答1: I believe that this issue answers your

Argument of type 'Http' is not assignable to parameter of type 'Http' in Ionic ngx-translate

Deadly 提交于 2019-12-03 11:07:13
I'm developing an Ionic 2 mobile app and want to use ngx-translate features. Following the tutorial, I'm importing necessary files in app module like this: import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { HttpModule, Http } from '@angular/http'; ... export function createTranslateLoader(http: Http) { return new TranslateHttpLoader(http, './assets/i18n/', '.json'); } which gives the error: Argument of type 'Http' is not assignable to parameter of type 'Http'. Property 'handler' is missing in type

Angular 6 - can't resolve all parameters for AppComponent

心不动则不痛 提交于 2019-12-03 06:14:33
I am trying to build an application with Angular 6 and I am still setting everything up. But it seems there is something wrong with the dependency injection in my app. It cannot resolve any constructor parameter. They all result in Uncaught Error: Can't resolve all parameters for AppComponent: (?). . Even a custom service results in the same error. Versions (omitted the dependencies that can't have any influence on this) "dependencies": { "@angular/common": "6.0.5", "@angular/compiler": "6.0.5", "@angular/core": "6.0.5", "@angular/forms": "6.0.5", "@angular/http": "6.0.5", "@angular/platform

Differences ngx-translate vs i18n

佐手、 提交于 2019-12-03 05:08:13
There are multiple methode to translate an (Angular) app, the big main methodes are : ngx-translate and Angular 2 native i18n As far I understood i18n is easier for SEO because of the clean url browsing with e.g app.com/de app.com/en on the other hand with ngx-translate it is easier to switch between languages. I know that the creator of ngx-translate was hired by Angular for their i18n. Can anybody say me what the main differences are (pro/cons)? I believe that this issue answers your question: https://github.com/ngx-translate/core/issues/495 According to @ocombe , The idea behind ngx

Angular ngx-translate usage in typescript

别等时光非礼了梦想. 提交于 2019-12-02 20:26:20
I'm using this @ngx-translate/core i18n service and it works fine in templates (.html) with this syntax: {{'my.i18n.key'|translate}} Now I want to translate something in my component typescript file (.ts) but I don't know how to use it. I can create translate object in my constructor: constructor(private translate: TranslateService) {} and now how to translate 'my.i18n.key' ? From the doc on github : get(key: string|Array, interpolateParams?: Object): Observable: Gets the translated value of a key (or an array of keys) or the key if the value was not found try in your controller/class:

Can't resolve all parameters for TranslateService: (?, ?, ?, ?, ?, [object Object]

淺唱寂寞╮ 提交于 2019-12-02 19:31:03
问题 I could not test my ionic 3 app in browser anymore since yesterday because I get the following error related to TranslateService . This seems not related to my code since I also face the same issue when I switch to my previous versions, although it worked fine at that moment. I tried to re-install the node modules with but still no luck. Do you know what I should do to solve this problem? Thanks! ERROR Error: Uncaught (in promise): Error: Can't resolve all parameters for TranslateService: (?,

Can't resolve all parameters for TranslateService: (?, ?, ?, ?, ?, [object Object]

半腔热情 提交于 2019-12-02 12:30:41
I could not test my ionic 3 app in browser anymore since yesterday because I get the following error related to TranslateService . This seems not related to my code since I also face the same issue when I switch to my previous versions, although it worked fine at that moment. I tried to re-install the node modules with but still no luck. Do you know what I should do to solve this problem? Thanks! ERROR Error: Uncaught (in promise): Error: Can't resolve all parameters for TranslateService: (?, ?, ?, ?, ?, [object Object], [object Object]). Error: Can't resolve all parameters for

i18n of lazy-loaded components in JHipster app

谁说我不能喝 提交于 2019-12-01 09:31:39
My App is based on JHipster and so the language services are provided by way of JhiLanguageService in the ng-jhipster library which uses a JhiConfigService to configure ngx-translate without my needing to import and configure the TranslateModule in my app.module . So when I add TranslateModule.forRoot(...) to imports of AppModule, everything breaks and I just see "translation not found..." messages everywhere. I don't know how to make my lazy-loaded pages use the same translation service instance as the eager-loaded part of the app so that changing the language in an eagerly-loaded component