Browse Source
Task/refactor language in various components (#6078)
* Refactor language
pull/6068/head
Thomas Kaul
3 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with
12 additions and
11 deletions
-
apps/client/src/app/app.component.ts
-
apps/client/src/app/components/admin-users/admin-users.component.ts
-
apps/client/src/app/components/header/header.component.ts
-
apps/client/src/app/components/user-account-access/user-account-access.component.ts
-
apps/client/src/app/components/user-account-settings/user-account-settings.component.ts
-
apps/client/src/app/core/auth.guard.ts
-
apps/client/src/app/pages/faq/overview/faq-overview-page.component.ts
-
apps/client/src/app/pages/faq/saas/saas-page.component.ts
-
apps/client/src/app/pages/faq/self-hosting/self-hosting-page.component.ts
|
|
@ -243,7 +243,7 @@ export class GfAppComponent implements OnDestroy, OnInit { |
|
|
this.tokenStorageService.signOut(); |
|
|
this.tokenStorageService.signOut(); |
|
|
this.userService.remove(); |
|
|
this.userService.remove(); |
|
|
|
|
|
|
|
|
document.location.href = `/${document.documentElement.lang}`; |
|
|
document.location.href = `/${$localize.locale}`; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
public ngOnDestroy() { |
|
|
|
|
|
@ -224,7 +224,7 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { |
|
|
this.tokenStorageService.signOut(); |
|
|
this.tokenStorageService.signOut(); |
|
|
this.userService.remove(); |
|
|
this.userService.remove(); |
|
|
|
|
|
|
|
|
document.location.href = `/${document.documentElement.lang}`; |
|
|
document.location.href = `/${$localize.locale}`; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
message: accessToken, |
|
|
message: accessToken, |
|
|
|
|
|
@ -335,7 +335,7 @@ export class GfHeaderComponent implements OnChanges { |
|
|
.subscribe((user) => { |
|
|
.subscribe((user) => { |
|
|
const userLanguage = user?.settings?.language; |
|
|
const userLanguage = user?.settings?.language; |
|
|
|
|
|
|
|
|
if (userLanguage && document.documentElement.lang !== userLanguage) { |
|
|
if (userLanguage && $localize.locale !== userLanguage) { |
|
|
window.location.href = `../${userLanguage}`; |
|
|
window.location.href = `../${userLanguage}`; |
|
|
} else { |
|
|
} else { |
|
|
this.router.navigate(['/']); |
|
|
this.router.navigate(['/']); |
|
|
|
|
|
@ -164,7 +164,7 @@ export class GfUserAccountAccessComponent implements OnDestroy, OnInit { |
|
|
this.tokenStorageService.signOut(); |
|
|
this.tokenStorageService.signOut(); |
|
|
this.userService.remove(); |
|
|
this.userService.remove(); |
|
|
|
|
|
|
|
|
document.location.href = `/${document.documentElement.lang}`; |
|
|
document.location.href = `/${$localize.locale}`; |
|
|
}, |
|
|
}, |
|
|
message: accessToken, |
|
|
message: accessToken, |
|
|
title: $localize`Security token` |
|
|
title: $localize`Security token` |
|
|
|
|
|
@ -78,7 +78,8 @@ export class GfUserAccountSettingsComponent implements OnDestroy, OnInit { |
|
|
public isAccessTokenHidden = true; |
|
|
public isAccessTokenHidden = true; |
|
|
public isFingerprintSupported = this.doesBrowserSupportAuthn(); |
|
|
public isFingerprintSupported = this.doesBrowserSupportAuthn(); |
|
|
public isWebAuthnEnabled: boolean; |
|
|
public isWebAuthnEnabled: boolean; |
|
|
public language = document.documentElement.lang; |
|
|
public language = $localize.locale; |
|
|
|
|
|
|
|
|
public locales = [ |
|
|
public locales = [ |
|
|
'ca', |
|
|
'ca', |
|
|
'de', |
|
|
'de', |
|
|
@ -199,7 +200,7 @@ export class GfUserAccountSettingsComponent implements OnDestroy, OnInit { |
|
|
this.tokenStorageService.signOut(); |
|
|
this.tokenStorageService.signOut(); |
|
|
this.userService.remove(); |
|
|
this.userService.remove(); |
|
|
|
|
|
|
|
|
document.location.href = `/${document.documentElement.lang}`; |
|
|
document.location.href = `/${this.language}`; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
confirmType: ConfirmationDialogType.Warn, |
|
|
confirmType: ConfirmationDialogType.Warn, |
|
|
|
|
|
@ -64,9 +64,9 @@ export class AuthGuard { |
|
|
.subscribe((user) => { |
|
|
.subscribe((user) => { |
|
|
const userLanguage = user?.settings?.language; |
|
|
const userLanguage = user?.settings?.language; |
|
|
|
|
|
|
|
|
if (userLanguage && document.documentElement.lang !== userLanguage) { |
|
|
if (userLanguage && $localize.locale !== userLanguage) { |
|
|
this.dataService |
|
|
this.dataService |
|
|
.putUserSetting({ language: document.documentElement.lang }) |
|
|
.putUserSetting({ language: $localize.locale }) |
|
|
.subscribe(() => { |
|
|
.subscribe(() => { |
|
|
this.userService.remove(); |
|
|
this.userService.remove(); |
|
|
|
|
|
|
|
|
|
|
|
@ -22,7 +22,7 @@ import { Subject, takeUntil } from 'rxjs'; |
|
|
templateUrl: './faq-overview-page.html' |
|
|
templateUrl: './faq-overview-page.html' |
|
|
}) |
|
|
}) |
|
|
export class GfFaqOverviewPageComponent implements OnDestroy { |
|
|
export class GfFaqOverviewPageComponent implements OnDestroy { |
|
|
public pricingUrl = `https://ghostfol.io/${document.documentElement.lang}/${publicRoutes.pricing.path}`; |
|
|
public pricingUrl = `https://ghostfol.io/${$localize.locale}/${publicRoutes.pricing.path}`; |
|
|
public routerLinkFeatures = publicRoutes.features.routerLink; |
|
|
public routerLinkFeatures = publicRoutes.features.routerLink; |
|
|
public user: User; |
|
|
public user: User; |
|
|
|
|
|
|
|
|
|
|
|
@ -22,7 +22,7 @@ import { Subject, takeUntil } from 'rxjs'; |
|
|
templateUrl: './saas-page.html' |
|
|
templateUrl: './saas-page.html' |
|
|
}) |
|
|
}) |
|
|
export class GfSaasPageComponent implements OnDestroy { |
|
|
export class GfSaasPageComponent implements OnDestroy { |
|
|
public pricingUrl = `https://ghostfol.io/${document.documentElement.lang}/${publicRoutes.pricing.path}`; |
|
|
public pricingUrl = `https://ghostfol.io/${$localize.locale}/${publicRoutes.pricing.path}`; |
|
|
public routerLinkAccount = internalRoutes.account.routerLink; |
|
|
public routerLinkAccount = internalRoutes.account.routerLink; |
|
|
public routerLinkAccountMembership = |
|
|
public routerLinkAccountMembership = |
|
|
internalRoutes.account.subRoutes.membership.routerLink; |
|
|
internalRoutes.account.subRoutes.membership.routerLink; |
|
|
|
|
|
@ -15,7 +15,7 @@ import { Subject } from 'rxjs'; |
|
|
templateUrl: './self-hosting-page.html' |
|
|
templateUrl: './self-hosting-page.html' |
|
|
}) |
|
|
}) |
|
|
export class GfSelfHostingPageComponent implements OnDestroy { |
|
|
export class GfSelfHostingPageComponent implements OnDestroy { |
|
|
public pricingUrl = `https://ghostfol.io/${document.documentElement.lang}/${publicRoutes.pricing.path}`; |
|
|
public pricingUrl = `https://ghostfol.io/${$localize.locale}/${publicRoutes.pricing.path}`; |
|
|
|
|
|
|
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
|
|