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.
642
questions
0
votes
0
answers
31
views
After upgrade Angular 10 to 14 @gilsdav/ngx-translate-router giving error
After upgrading from angular 10 to angular 14 @gilsdav/ngx-translate-router giving error. I have updated the package to latest version but still getting this error
0
votes
0
answers
12
views
Problem with TranslateService - no provider for TranslateService [closed]
I have this common problem with translate but solutions in Internet doesnt work for me.
core.js:6456 ERROR NullInjectorError: R3InjectorError(AppModule)[TranslateService -> TranslateService -> ...
0
votes
2
answers
43
views
Ngx-translate: Change path to localization files
In ngx-translate library, is there a way how to change the path where TranslateService looks for localization files (en-GB etc.)? The default one is src/assets/i18n/[lang].json.
I followed this ...
-1
votes
0
answers
5
views
Better code for ngx-translate of Kendo UI DrawerItem
I am using KendoUI and am using ngx-translate to translate DrawerItem text entries. I have everything up and running but it is fugly! I extended the Route config object so that I only need to keep my ...
0
votes
1
answer
12
views
Double template search in angular
On one hand, I have a list of links that gets displayed as follows
<mat-nav-list>
<mat-list-item *ngFor="let link of links">
<a matLine href="{{link.url}}"> ...
-1
votes
2
answers
47
views
Angular ngx-translate save selected language
I have such a problem I use ngx-translate for translation. When I choose a language, it is saved in localStorage, but when I refresh the page, it disappears and returns me the keys that I wrote. And ...
0
votes
1
answer
30
views
ionic 5 using local file when offline for tranlation
I am having a ionic 5 app where i am using translation with
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
...
0
votes
1
answer
17
views
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',
...
1
vote
2
answers
21
views
Are dots allowed in keys in ngx-translate
I have a problem in the codebase that I'm working on right now related to keys with dots.
Basically, the i18n JSON contains something like:
{
a: {
title: 'Title for a'
},
b: {
title: '...
1
vote
1
answer
56
views
How do you get ngx-translate work with angular material
I'm a novice at Angular and have an angular app 13.3.6 with angular material 13.3.6 and ngx-translate 14.0.0. I use mat-option to select my languages, however when I click them, they don't change the ...
0
votes
0
answers
14
views
Ionic IOS ngx-translate
i have any problems with ngx.translate on IOS.
On android device all function perfectly but on IOS ngx-traslate not work.
In the main view i can choose the language, if i choose "fr" i set &...
0
votes
2
answers
154
views
Angular 13 i18n - ngx-translate - No pipe found with name 'translate' - How to fix?
I've followed this instruction to install and use ngx-translate and did minor modification as per my requirement. But I'm not able to find what mistake I've done.
Error in src/app/feature/test-1/abc/...
1
vote
1
answer
42
views
Include hash in translation JSON asset file name
I store my translation files as JSON in /src/assets/i18n. In order to bust cache, I want to fingerprint / include hash to the filename and use the hashed file named when I retrieve the file over HTTP. ...
0
votes
0
answers
33
views
Dynamically imported JSON file content included in main bundle
I'm using Angular. For loading translation JSON files, I use dynamic imports. Eg.,
import { from, Observable } from 'rxjs';
import { TranslateLoader } from '@ngx-translate/core';
export class ...
-2
votes
1
answer
21
views
Is there any platform where I can update my translations files for instance en.json with ngx translate?
I am looking for a plaftorm where I can update my translations file and it can be retrieve as a json file to place it on my angular app using ngx translate. Any recommendations. ?
Something like ...
1
vote
2
answers
63
views
ngx-translate usage in typescript Angular
I'm using this @ngx-translate/core and @ngx-translate/http-loader i18n service and it works fine in templates (.html)
{{'title'|translate}}
Now I want to translate in my component typescript file (....
1
vote
1
answer
136
views
Ngx-Translate doesn't get translations after page refresh
I'm working on Angular 13 app, and I have a problem with ngx-translate.
The problem is that, when I'm navigating through the project, translations which I'm getting using TranslateService are working ...
0
votes
0
answers
47
views
Angular material input on arabic language not working
In ngx-translate, when language is changed from English to Arabic, Angular Material input is showing like this:
How can I solve this?
0
votes
0
answers
25
views
Supplied parameters do not match any signature of call target - angular 4
I'm using ngx-translate in service. Exactly in this function.
@Injectable()
export class StartService {
constructor(private translateService: TranslateService) { }
load(): Promise<...
0
votes
0
answers
32
views
Property 'translateService' does not exist on type 'typeof DataTableBaseOptions'
I have this error: Property 'translateService' does not exist on type 'typeof DataTableBaseOptions'. that I didn't understand why happens only in this code:
I have:
export default class ...
0
votes
1
answer
109
views
Angular - bind InnerHTML with translate in TS file
I have a problem with binding into property to get html and translate it.
I have an innerHTML that I am trying to map to translate.
The problem is it is not translating and displaying the key as it is....
0
votes
1
answer
47
views
How do I test a component in Angular that with a helper method that requires TranslateService?
I have a custom Validator that uses ngx-translate
export class CustomValidator {
static translation: TranslateService;
static setTranslationService( translation: TranslateService): void {
...
0
votes
1
answer
56
views
No array operations work on getLangs() from ngx-translate/core TranslateService
I work on an Angular (v13) project which uses ngx-translate/core for i18n. There are multiple languages (15 currently) configured. I find the following very strange behaviour (TranslateService is ...
0
votes
1
answer
58
views
Angular Translate arrow function factory
When I import TranslateModule using this code:
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
})
...
0
votes
1
answer
39
views
Prevent nested paragraphs with ngx-translate in Angular 13
We use ngx-translate to provide multi-language support in an Angular 13 application. This works like a charm except when multiple paragraphs are defined in a translation string. For example the ...
0
votes
2
answers
282
views
How to pass variables in TS files in NGX Translate
as we know ,in HTML file, we can use pipe to pass variable like this , so that different language can turn into inversion,
how can I make it in ts file.
<div class="condition">{{ '...
1
vote
0
answers
134
views
Angular - How to set LOCALE_ID based on ngx-translate currentLang?
I noticed that dates are not properly formatted according to the browser language in my angular application when using the date pipe. To fix this, I tried to implement the suggestion from this answer ...
-1
votes
1
answer
129
views
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:
...
2
votes
1
answer
115
views
Angular "as" keyword or how to use a variable in html
I use ngx-translate in angular 13 and often have something like this in html
<div> {{ 'prefix.'+'my translation key'+'.suffix' | translate }} </div>
now, the question is that when that ...
0
votes
2
answers
52
views
How to specify which pipe to use if multiple modules exported same name pipes?
In my project, I'm using NgxExtendedPdfViewerModule & TranslateModule(@ngx-translate/core). Both packages export translate pipe.
The translate pipe from NgxExtendedPdfViewerModule returns Promise&...
0
votes
0
answers
35
views
String interpolation is not working in ngx-translate
I used ngx-translate for my project. String Interpolation is not working in some components. I attached a screenshot for this.
In my HTML : {{ Players.availableResources | translate }}
However, I'm ...
0
votes
2
answers
255
views
Ionic issue at serve => NullInjectorError: No provider for TranslateService
I created an Ionic 6 project which uses @ngx-translate module as a dependency. When I serve with ionic s, I got a blank page and the following error in the JS console:
core.mjs:6485 ERROR Error: ...
0
votes
1
answer
419
views
NGX translate custom loader not getting called if we select the same language
I am using ngx translate with Angular 9. Here are my dependencies:
@angular/cli": "^9.0.1"
@ngx-translate/core": "^12.1.2",
@ngx-translate/http-loader": "^5.0.0&...
0
votes
0
answers
88
views
angular ngx-translate error in TypeScript 4.5.5
i'm following this tutoria; ([https://www.carloscaballero.io/angular-ngx-translate-typings/][1]) to using ngx-translate.
when i made a service for translate(translation.service.ts) i got an error:
(...
0
votes
0
answers
133
views
Translate a JSON file using ngx-translate
I have a JSON file with static data that I want to translate it.
{
"id": "",
"name": "text",
"label": "Text&...
2
votes
1
answer
2k
views
Can not start Angular Website after @ngx-translate Installation
I have installed @ngx-translate/core Version 14.0.0 and @ngx-translate/http-loader Version ^7.0.0 in my Application and followed a few tutorials (eg. this) on how to add Multiple Languages to an ...
0
votes
1
answer
113
views
Types have separate declarations of a private property 'handler'
I'm trying to internationalize my angular app. Unfortunately, I get this error message " Types have separate declarations of a private property 'handler'. " I know that there is already a ...
0
votes
0
answers
46
views
Angular Test: to test app.module.ts ngx-translate
I dont seem to find any good article for testing things in app.module.ts
I recently using ngx-translate library and I have the code in app.module.ts
I am wondering how to write test against code in ...
0
votes
1
answer
127
views
Translate words into the class component (.ts) with ngx-translate (Angular)
I want to translate the content of a table into my typescript class. The table's data are fetched from JSON file located into /assets.
Is there a way to achieve that?
How I can mark translation into a ...
0
votes
1
answer
440
views
Angular multi-language input field for entering text in multiple languages
I am working on a multi-language web application using Angular 12 and ASP.NET Core 6 for the backend. For the most part, all interactions with the backend are simple CRUD operations. In many cases, ...
0
votes
1
answer
293
views
NullInjectorError: No provider for TranslateService in dependency
I created a custom Angular Library which uses TranslateModule as a dependency. When i use this library inside my main application as a NPM dependency, my application compile correctly, but the ...
0
votes
1
answer
532
views
ngx-translate: Event to detect changing language (Angular)
I want to detect the switch of the "current language" using ngx-translate library.
Which js event I can use to achieve that?
To better understand what I mean, please check this simple ...
0
votes
1
answer
93
views
ngx-translate set of values in for loop
I've got this for loop in my .html file
<div class="dashboard-modules">
<mat-grid-list cols="4" rowHeight="200px">
<mat-grid-tile *ngFor="let item ...
0
votes
2
answers
1k
views
Translate text in a custom angular pipe (ngx-translate)
I am using ngx-translate for my translations in my angular app.
In a custom pipe I have some text that need to be translated.
pipe:
import { Pipe, PipeTransform } from '@angular/core';
import { ...
0
votes
1
answer
112
views
Using ngx-translate to display images
I would like to use ngx-translate inside my Angular app to display a language-specific image. In my case its a Logo which is displayed in different languages and styles depending on the used language.
...
0
votes
0
answers
82
views
How to use regular expression in JSON as key
Is it even possible to do so? I didn't find a single solution on the internet. I'm working on Angular 6 project. I've to translate few strings and for that I'm maintaining one en-US.json file in i18n ...
0
votes
0
answers
76
views
recall apis that depending on lang param with ngx-translate
I'm using ngx-translate when I change the language to 'ar' it makes the dir property to 'rtl' and it works fine
the problem is that I'm using a 'lang' value from localStorage to send it with each ...
2
votes
1
answer
826
views
Angular 13 dynamic locale change
To localize my Angular 13 application I followed the official guide: https://angular.io/guide/i18n-example, created *.xlf files with translations, everything seems to work fine so far.
Now, I wonder ...
0
votes
0
answers
465
views
Angular ngx-translate usage in typescript object array
I am using ngx-translate for translation.
In my typescript file I have a array of objects. how can I use a i18n key in this array?
shortcutList: Shortcut[] = [];
constructor(private translate: ...
1
vote
1
answer
258
views
Angular ngx-translate, does not translate first time
I use ngx-translate with angular. When the site is opened on a new pc, the translation does not show, only the keys. Then the user have to press F5 for it to translate. Happens every time as far as I ...