import { I18nService } from './../../../core/i18n/i18n.service'; import { Component, Input, Inject } from '@angular/core'; import { BooleanInput, NzSafeAny } from 'ng-zorro-antd/core/types'; import { InputBoolean } from 'ng-zorro-antd/core/util'; import { DOCUMENT } from '@angular/common'; import { RhStorageService } from 'rh-base/core'; @Component({ selector: 'rh-header-i18n', templateUrl: './header-i18n.component.html', styleUrls: ['./header-i18n.component.less'] }) export class HeaderI18nComponent { // static ngAcceptInputType_showLangText: BooleanInput; // /** Whether to display language text */ // @Input() @InputBoolean() showLangText = true; // get langs(): Array<{ code: string; text: string; abbr: string }> { // return this.i18n.getLangs(); // } // get curLangCode(): string { // return this.storage.defaultSetting.lang; // } // constructor(private i18n: I18nService, @Inject(DOCUMENT) private doc: NzSafeAny, private storage: RhStorageService) { } // change(lang: string): void { // const spinEl = this.doc.createElement('div'); // spinEl.setAttribute('class', `page-loading ant-spin ant-spin-lg ant-spin-spinning`); // spinEl.innerHTML = ``; // this.doc.body.appendChild(spinEl); // this.i18n.use(lang); // this.storage.setDefaultSetting('lang', lang); // setTimeout(() => this.doc.location.reload()); // } }