Skip to content

Commit 42567e8

Browse files
committed
Minor enhancements for localization
1 parent d64cb2f commit 42567e8

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

eform-client/src/app/common/services/auth/locale.service.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class LocaleService extends BaseService {
5555
if (!currentUserLocale) {
5656
currentUserLocale = 'en-US';
5757
localStorage.setItem('locale', currentUserLocale);
58-
this.translateService.setDefaultLang('en-US');
58+
this.translateService.setDefaultLang(currentUserLocale);
5959
this.translateService.use(currentUserLocale);
6060
}
6161
return currentUserLocale;
@@ -64,13 +64,11 @@ export class LocaleService extends BaseService {
6464

6565
initCookies(locale: string) {
6666
this.translateService.setDefaultLang('en-US');
67-
let culture = '';
67+
let culture = this.buildCookieValue('en-US');
6868
if (locale === 'da-DK') {
6969
culture = this.buildCookieValue('da');
70-
} else if (locale === 'de-DE') {
71-
culture = this.buildCookieValue('de-DE');
72-
} else {
73-
culture = this.buildCookieValue('en-US');
70+
} else if (locale) {
71+
culture = this.buildCookieValue(locale);
7472
}
7573
this.cookieService.set('culture', culture, 9999999, '/');
7674
this.cookieService.set('locale', locale, 9999999, '/');

eform-client/src/app/modules/auth/components/auth/login/login.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {AbstractControl, FormBuilder, FormGroup, Validators} from '@angular/form
33
import {Router} from '@angular/router';
44
import {ToastrService} from 'ngx-toastr';
55
import {AuthResponseModel, GoogleAuthenticatorModel, LoginRequestModel} from 'src/app/common/models/auth';
6-
import {LoginPageSettingsModel} from 'src/app/common/models/settings';
76
import {AppSettingsService} from 'src/app/common/services/settings/app-settings';
87
import {AuthService, LocaleService, UserSettingsService} from 'src/app/common/services/auth';
98

eform-client/src/app/plugins/modules/shared/services/shared-pn.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export class SharedPnService extends BaseService {
2222
}
2323

2424
getLocalPageSettings(localStorageItemName: string, pageName?: string): ApplicationPageModel {
25-
// debugger;
2625
const localPagesSettings = localStorage.getItem(localStorageItemName);
2726
let result;
2827
if (pageName) {

0 commit comments

Comments
 (0)