forked from mirrors/misskey
refactor(sw): use fully typed locales (#14470)
* refactor(sw): use fully typed locales * fix(backend): enumerate achievement notification type
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
* Language manager for SW
|
||||
*/
|
||||
import { get, set } from 'idb-keyval';
|
||||
import { I18n, type Locale } from '@/scripts/i18n.js';
|
||||
import { I18n } from '../../../frontend/src/scripts/i18n.js';
|
||||
import type { Locale } from '../../../../locales/index.js';
|
||||
|
||||
class SwLang {
|
||||
public cacheName = `mk-cache-${_VERSION_}`;
|
||||
@@ -23,7 +24,7 @@ class SwLang {
|
||||
return this.fetchLocale();
|
||||
}
|
||||
|
||||
public i18n: Promise<I18n> | null = null;
|
||||
public i18n: Promise<I18n<Locale>> | null = null;
|
||||
|
||||
public fetchLocale(): Promise<I18n<Locale>> {
|
||||
return (this.i18n = this._fetch());
|
||||
|
||||
Reference in New Issue
Block a user