fix i18n iframe
This commit is contained in:
@@ -8,7 +8,7 @@ import { fromEvent } from 'rxjs';
|
||||
import { AuthService } from '../../services/auth.service';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { ProfileService } from '../../services/profile.service';
|
||||
import { MatSidenav } from '@angular/material/sidenav';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-main',
|
||||
@@ -36,6 +36,7 @@ export class MainComponent {
|
||||
private router: Router,
|
||||
private iconRegistry: MatIconRegistry,
|
||||
private sanitizer: DomSanitizer,
|
||||
private location: Location,
|
||||
private _adapter: DateAdapter<any>) {
|
||||
iconRegistry.addSvgIcon('logo', sanitizer.bypassSecurityTrustResourceUrl('assets/icons/logo.svg'));
|
||||
}
|
||||
@@ -71,7 +72,9 @@ export class MainComponent {
|
||||
setLocale(locale) {
|
||||
try {
|
||||
localStorage.setItem("bstly.locale", locale);
|
||||
} catch { }
|
||||
} catch {
|
||||
this.location.replaceState(window.location.pathname, 'locale=' + locale);
|
||||
}
|
||||
|
||||
if (this.auth && this.auth.authenticated) {
|
||||
this.profileService.getField("locale").subscribe({
|
||||
|
||||
Reference in New Issue
Block a user