forked from mirrors/misskey
翻訳ファイルをランタイムで読み込み
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"globals": {
|
||||
"_DEV_": false,
|
||||
"_LANG_": false,
|
||||
"_LANGS_": false,
|
||||
"_LOCALE_": false,
|
||||
"_VERSION_": false,
|
||||
"_ENV_": false,
|
||||
"_PERF_PREFIX_": false,
|
||||
|
||||
2
src/client/@types/global.d.ts
vendored
2
src/client/@types/global.d.ts
vendored
@@ -1,6 +1,4 @@
|
||||
declare const _LANG_: string;
|
||||
declare const _LANGS_: string[][];
|
||||
declare const _LOCALE_: Record<string, any>;
|
||||
declare const _VERSION_: string;
|
||||
declare const _ENV_: string;
|
||||
declare const _DEV_: boolean;
|
||||
|
||||
@@ -6,9 +6,9 @@ export const hostname = address.hostname;
|
||||
export const url = address.origin;
|
||||
export const apiUrl = url + '/api';
|
||||
export const wsUrl = url.replace('http://', 'ws://').replace('https://', 'wss://') + '/streaming';
|
||||
export const lang = _LANG_;
|
||||
export const lang = localStorage.getItem('lang');
|
||||
export const langs = _LANGS_;
|
||||
export const locale = _LOCALE_; // TODO: code splittingするため、翻訳ファイルを分割したうえでwebpackのimport alias使って読み込むようにしたい
|
||||
export const locale = JSON.parse(localStorage.getItem('locale'));
|
||||
export const version = _VERSION_;
|
||||
export const instanceName = siteName === 'Misskey' ? host : siteName;
|
||||
export const ui = localStorage.getItem('ui');
|
||||
|
||||
Reference in New Issue
Block a user