diff --git a/.i18nrc.cjs b/.i18nrc.cjs index 2eb845ade..df31939b5 100644 --- a/.i18nrc.cjs +++ b/.i18nrc.cjs @@ -4,7 +4,7 @@ const { defineConfig } = require('@lobehub/i18n-cli'); module.exports = defineConfig({ - entry: 'src/locales/en.json', + entry: 'src/locales/en', entryLocale: 'en', output: 'src/locales', outputLocales: ['zh', 'ru', 'ja', 'ko'], diff --git a/scripts/collect-i18n.ts b/scripts/collect-i18n.ts index 59bdf71bd..788d2ea4f 100644 --- a/scripts/collect-i18n.ts +++ b/scripts/collect-i18n.ts @@ -8,7 +8,7 @@ import type { ComfyCommandImpl } from '../src/stores/commandStore' import type { FormItem, SettingParams } from '../src/types/settingTypes' import type { ComfyApi } from '../src/scripts/api' -const localePath = './src/locales/en.json' +const localePath = './src/locales/en/main.json' const extractMenuCommandLocaleStrings = (): Set => { const labels = new Set() for (const [category, _] of CORE_MENU_COMMANDS) { diff --git a/src/i18n.ts b/src/i18n.ts index 3275d6896..ad6bd6e07 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,9 +1,9 @@ import { createI18n } from 'vue-i18n' -import en from './locales/en.json' -import zh from './locales/zh.json' -import ru from './locales/ru.json' -import ja from './locales/ja.json' -import ko from './locales/ko.json' +import en from './locales/en/main.json' +import zh from './locales/zh/main.json' +import ru from './locales/ru/main.json' +import ja from './locales/ja/main.json' +import ko from './locales/ko/main.json' export const i18n = createI18n({ // Must set `false`, as Vue I18n Legacy API is for Vue 2 diff --git a/src/locales/en.json b/src/locales/en/main.json similarity index 100% rename from src/locales/en.json rename to src/locales/en/main.json diff --git a/src/locales/ja.json b/src/locales/ja/main.json similarity index 100% rename from src/locales/ja.json rename to src/locales/ja/main.json diff --git a/src/locales/ko.json b/src/locales/ko/main.json similarity index 100% rename from src/locales/ko.json rename to src/locales/ko/main.json diff --git a/src/locales/ru.json b/src/locales/ru/main.json similarity index 100% rename from src/locales/ru.json rename to src/locales/ru/main.json diff --git a/src/locales/zh.json b/src/locales/zh/main.json similarity index 100% rename from src/locales/zh.json rename to src/locales/zh/main.json