0

Please or Register to create posts and topics.

Change default language?

I've been trying to add a language without much luck.  Added an es.json file (copied the en.json and changed some values)

Changed the  readonly defaultLanguage = "es";  in the service.

Added the es.json file to the getTranslation

In the app.components.ts change the constructure to

translationService.addLanguages(["en", "fr", "de", "pt", "ar", "es"]);
translationService.setDefaultLanguage('es');

 

But, still, everytime a new user logs in, default goes to english.  Sometimes  I get .pipe is not a function error.  Any help?

The last bit you'll need to modify is AppTranslationService.useBrowserLanguage();
Add your language "es" this line "if (browserLang.match(/en|fr|de|ar|ko|pt/))"

This is called from ConfigurationService.resetLanguage() and is what might be resetting your language to en.