Questions tagged [ng2-translate]
89 questions
1
vote
0 answers
Using intro.js in multilingual angular 2 page
I am developing a multilingual web page using angular 2 .
I wanted to add some guide for my users using intro.js ( consider that I am using the DefinitelyTyped library ) . it is okay when I write my guides in single language for example by this line…

peyman ghasemi
- 11
- 3
1
vote
0 answers
How to translate date-time for multi local in ionic 2 with ng2-translate?
I want to translate ionic date-time. That's why I'm using ng2-translate package.
here, I'm using monthNames="{{…

Rashed Shaon
- 348
- 2
- 4
- 17
1
vote
1 answer
Change language on Ionic2 - What is the most effective way to change all page language?
I am trying to use ng2-translate on Ionic2 to do the multi-language, and I added a button for changing the language of the Apps on the setting page. Basically, the function of changing language is work on the setting page only, but the other page…

Capslock10
- 796
- 2
- 16
- 37
1
vote
0 answers
How to handle huge translation tables in Angular2
It seems i18n is still neglected in Angular2. I've been expecting that someone came up with translation files per component like you could reference styleUrls for CSS. That doesn't seem to be planned right now. It would also be giant leap forward if…

Jan B.
- 6,030
- 5
- 32
- 53
1
vote
1 answer
Using ng2-translate pipe or directive for placeholder
I would like to use ng2-translate for placeholder. Only way to do this I found is use ng2-translate service and pass variable to placeholder like this:
class Form {
placeholder: string;
constructor(translate: TranslateService) {
…

qwe asd
- 1,598
- 3
- 21
- 31
1
vote
0 answers
Get translation for two keys in ng2-translate with pipe
I have this situation where I interpolate error variable which contains dynamic values.
{{ errorMsg | translate }}
I feed errorMsg a key everytime there is an error of any kind. Like
this.errorMsg = "error.loading.results"
this.errorMsg =…

Parth Chokshi
- 642
- 4
- 16
1
vote
1 answer
Translation Texts using ng2-translate
I used ng2-translate to translate headings and texts in my angular2 web app.
But I am now confused when I trying to translate texts that pass from .ts file.
for example, I can translate texts in html file as following.
…

Dilanka Rathnayake
- 660
- 2
- 11
- 32
1
vote
1 answer
Ng2-translate - Fallback to default language when file doesn't exist
I have set up ng2-translate which translates my entire app and I have an en-GB.json file which contains all of my translations. The problem I have now is that if the user's device is set to another language (e.g. 'en-US'), I get 404 errors saying…

Daniel Hutton
- 1,455
- 1
- 17
- 33
1
vote
1 answer
ng2-translate + Webpack for production
I'm trying to use the ng2-translate package with Webpack. In development mode it all works fine.
When i'm starting a build, it doesn't copy the language files to the "dist" directory.
Can anyone give me some advices how to change the output path, I…

Dimitri
- 57
- 8
1
vote
1 answer
How to build Angular2 app with external json file using angular-cli in prod mode?
My Angular2 app is using ng2-translate module and 'en.json' file contains translation.
This is all working well in dev mode when built end deployed with angular-cli.
But when built in prod mode, and deployed to WildFly, en.json is not found and…

Marin Relatic
- 238
- 2
- 9
1
vote
1 answer
Race Condition with ng2-translate
My app.component looks like this:
export class AppComponent {
public constructor(public translate: TranslateService) {
const userLang = navigator.language.split('-')[0];
const acceptedUserLang = /(de|en)/gi.test(userLang) ?…

stofl
- 2,950
- 6
- 35
- 48
1
vote
1 answer
Angular2 - TypeScript to JavaScript ES6 Syntax - ng2-translate
I am trying to implement ng2-translate pipe on my Angular2/Ionic2 app which is totally written on JavaScript ES6.
However, I am stuck on a step in the setup phase in which I need to write a piece of code in JavaScript ES6.
What I found so far on…

Hamza L.
- 1,783
- 4
- 25
- 47
1
vote
0 answers
Angular 2 and conflict with XHRBackend
I have a problem when I use ng2-translate and XHRBackend
{ provide: XHRBackend, useClass: InMemoryBackendService } in my bootstrap
(with import { InMemoryBackendService, SEED_DATA} from 'angular2-in-memory-web-api')
I get exception:
"ORIGINAL…

Egor
- 2,122
- 2
- 21
- 23
1
vote
1 answer
Angular 2 RC4 provider error ng2-translate
I'm using ng2-translate with angular2 and it's working really well. The point is I just updated angular to RC4 yesterday and I have a problem with the ng2-translate module I guess.
I have this error:
Unhandled Promise rejection: Error: Invalid…

Julien Moreau
- 151
- 1
- 4
- 16
1
vote
2 answers
angular2 translate ionic 2 No provider for Http! (MyApp -> TranslateService -> Http)
I am using ionic2/angular2 and ng2-translate. I get an error of "No provider for Http! (MyApp -> TranslateService -> Http)". I am not using typescript. I believe that this code is in typescript form. can someone help me convert it to javascript.…

rklumanlan
- 11
- 3