feat: 完善图像工作区与创作工具体验
This commit is contained in:
@@ -6,13 +6,6 @@ import {
|
||||
type LanguageCode,
|
||||
} from '../../shared/language';
|
||||
|
||||
// EN
|
||||
import enCommon from './locales/en/common.json';
|
||||
import enSettings from './locales/en/settings.json';
|
||||
import enChat from './locales/en/chat.json';
|
||||
import enSetup from './locales/en/setup.json';
|
||||
import enDashboard from './locales/en/dashboard.json';
|
||||
|
||||
// ZH
|
||||
import zhCommon from './locales/zh/common.json';
|
||||
import zhSettings from './locales/zh/settings.json';
|
||||
@@ -20,35 +13,11 @@ import zhChat from './locales/zh/chat.json';
|
||||
import zhSetup from './locales/zh/setup.json';
|
||||
import zhDashboard from './locales/zh/dashboard.json';
|
||||
|
||||
// JA
|
||||
import jaCommon from './locales/ja/common.json';
|
||||
import jaSettings from './locales/ja/settings.json';
|
||||
import jaChat from './locales/ja/chat.json';
|
||||
import jaSetup from './locales/ja/setup.json';
|
||||
import jaDashboard from './locales/ja/dashboard.json';
|
||||
|
||||
// RU
|
||||
import ruCommon from './locales/ru/common.json';
|
||||
import ruSettings from './locales/ru/settings.json';
|
||||
import ruChat from './locales/ru/chat.json';
|
||||
import ruSetup from './locales/ru/setup.json';
|
||||
import ruDashboard from './locales/ru/dashboard.json';
|
||||
|
||||
export const SUPPORTED_LANGUAGES = [
|
||||
{ code: 'en', label: 'English' },
|
||||
{ code: 'zh', label: '中文' },
|
||||
{ code: 'ja', label: '日本語' },
|
||||
{ code: 'ru', label: 'Русский' },
|
||||
] as const satisfies ReadonlyArray<{ code: LanguageCode; label: string }>;
|
||||
|
||||
const resources = {
|
||||
en: {
|
||||
common: enCommon,
|
||||
settings: enSettings,
|
||||
chat: enChat,
|
||||
setup: enSetup,
|
||||
dashboard: enDashboard,
|
||||
},
|
||||
zh: {
|
||||
common: zhCommon,
|
||||
settings: zhSettings,
|
||||
@@ -56,20 +25,6 @@ const resources = {
|
||||
setup: zhSetup,
|
||||
dashboard: zhDashboard,
|
||||
},
|
||||
ja: {
|
||||
common: jaCommon,
|
||||
settings: jaSettings,
|
||||
chat: jaChat,
|
||||
setup: jaSetup,
|
||||
dashboard: jaDashboard,
|
||||
},
|
||||
ru: {
|
||||
common: ruCommon,
|
||||
settings: ruSettings,
|
||||
chat: ruChat,
|
||||
setup: ruSetup,
|
||||
dashboard: ruDashboard,
|
||||
},
|
||||
};
|
||||
|
||||
i18n
|
||||
@@ -77,7 +32,7 @@ i18n
|
||||
.init({
|
||||
resources,
|
||||
lng: resolveSupportedLanguage(typeof navigator !== 'undefined' ? navigator.language : undefined),
|
||||
fallbackLng: 'en',
|
||||
fallbackLng: 'zh',
|
||||
supportedLngs: [...SUPPORTED_LANGUAGE_CODES],
|
||||
defaultNS: 'common',
|
||||
ns: ['common', 'settings', 'chat', 'setup', 'dashboard'],
|
||||
|
||||
Reference in New Issue
Block a user