mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge branch 'master' into community-and-collection-forms
Conflicts: src/app/core/data/item-data.service.spec.ts src/app/core/data/item-data.service.ts src/app/core/shared/operators.spec.ts src/app/core/shared/operators.ts src/app/shared/shared.module.ts
This commit is contained in:
@@ -60,10 +60,18 @@ export class AppComponent implements OnInit, AfterViewInit {
|
||||
private menuService: MenuService,
|
||||
private windowService: HostWindowService
|
||||
) {
|
||||
// this language will be used as a fallback when a translation isn't found in the current language
|
||||
translate.setDefaultLang('en');
|
||||
// the lang to use, if the lang isn't available, it will use the current loader to get them
|
||||
translate.use('en');
|
||||
// Load all the languages that are defined as active from the config file
|
||||
translate.addLangs(config.languages.filter((LangConfig) => LangConfig.active === true).map((a) => a.code));
|
||||
|
||||
// Load the default language from the config file
|
||||
translate.setDefaultLang(config.defaultLanguage);
|
||||
|
||||
// Attempt to get the browser language from the user
|
||||
if (translate.getLangs().includes(translate.getBrowserLang())) {
|
||||
translate.use(translate.getBrowserLang());
|
||||
} else {
|
||||
translate.use(config.defaultLanguage);
|
||||
}
|
||||
|
||||
metadata.listenForRouteChange();
|
||||
|
||||
|
Reference in New Issue
Block a user