ionic 3 angular ngx-translate using default language

Viewed 350

I have defined two languages en and de. if i explictly set using

this.translate.use('de')

i see the desired results. I wanted to use english literals in case a translation is missing instead of showing the keyvalue. Based on the documentation if I add as follows:

constructor(translate: TranslateService) {
        // this language will be used as a fallback when a translation isn't found in the current language
        translate.setDefaultLang('en');
    }

the translation is always in english. in other words the translate.use('de') then has no effect. My understanding was the above setDefaulting will convert only those strings to english for which a 'de' translation is missing.

0 Answers
Related