Open skorunka opened 6 years ago
I have the same error
Same problem with 0.8.2
.
Same problem here. No errors nor warnings.
v 0.8.2
In my case I've solved the problem specifying the default property of the imported json (ie. enUS.default):
import * as enUS from '../../../translations/en-US.json';
....
@Injectable()
export class I18nService {
defaultLanguage: string;
supportedLanguages: string[];
constructor(private translateService: TranslateService) {
translateService.setTranslation('en-US', enUS.default);
....
Can confirm @gerardcarbo solution works. Thank you.
thx @gerardcarbo, your solution worked for me too
if that could help someone else, if you load many languages, like me fr/de/it/en, you have to do the tricks for each of your languages
For example:
this.translateService.addLangs(['en', 'de', 'fr', 'it']);
this.translateService.setDefaultLang('en');
this.translateService.setTranslation('en', translationEn.default);
this.translateService.setTranslation('fr', translationFr.default);
this.translateService.setTranslation('it', translationIt.default);
this.translateService.setTranslation('de', translationDe.default);
The translations stop silently working after upgrading
@angular-devkit/build-angular
from0.7.5
to0.8.0
or0.8.1
. There is no error in the console or anywhere. Beta versions0.9.0-beta.1
and^0.9.0-beta.2
do not work as well.