Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit b2a8ddb

Browse files
fix: incompatibility between translations and angular-devkit/build-angular
1 parent 420ec00 commit b2a8ddb

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/app.component.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import {Meta} from '@angular/platform-browser';
44
import {Observable, Subscription} from 'rxjs';
55

66
import {TranslateService} from '@ngx-translate/core';
7+
8+
import * as translationEn from 'assets/i18n/en.json';
9+
import * as translationFr from 'assets/i18n/fr.json';
10+
import * as translationIt from 'assets/i18n/it.json';
11+
import * as translationDe from 'assets/i18n/de.json';
12+
713
import {isPlatformServer} from '@angular/common';
814

915
import {Resources} from '../providers/core/utils/resources';
@@ -115,6 +121,12 @@ export class AppComponent implements OnInit, OnDestroy {
115121
this.translateService.addLangs(['en', 'de', 'fr', 'it']);
116122
this.translateService.setDefaultLang('en');
117123

124+
// https://github.com/ngx-translate/core/issues/922
125+
this.translateService.setTranslation('en', translationEn.default);
126+
this.translateService.setTranslation('fr', translationFr.default);
127+
this.translateService.setTranslation('it', translationIt.default);
128+
this.translateService.setTranslation('de', translationDe.default);
129+
118130
if (isPlatformServer(this.platformId)) {
119131
return this.initLangServer();
120132
} else {

0 commit comments

Comments
 (0)