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.
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…
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…
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 =…
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…
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…
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:
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(),
…
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 +…
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…
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 {…
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'
]);
…
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…
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…
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.
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]
}
…