diff --git a/i18next.config.ts b/i18next.config.ts index 75e816329c..d3429d205e 100644 --- a/i18next.config.ts +++ b/i18next.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from 'i18next-cli' /** @see https://github.com/i18next/i18next-cli */ export default defineConfig({ - locales: ['en-us', 'zh-cn', 'zh-tw'], + locales: ['en-us', 'zh-cn', 'zh-tw', 'de-de', 'el-gr', 'es-es', 'fr-fr', 'ja-jp', 'pt-pt', 'ru-ru'], extract: { input: 'src/renderer/src/**/*.{ts,tsx}', output: 'src/renderer/src/i18n/locales/{{language}}.json', diff --git a/scripts/auto-translate-i18n.ts b/scripts/auto-translate-i18n.ts index a9d7b31d94..350715a922 100644 --- a/scripts/auto-translate-i18n.ts +++ b/scripts/auto-translate-i18n.ts @@ -9,7 +9,6 @@ import * as fs from 'fs' import * as path from 'path' const localesDir = path.join(__dirname, '../src/renderer/src/i18n/locales') -const translateDir = path.join(__dirname, '../src/renderer/src/i18n/translate') const baseLocale = process.env.BASE_LOCALE ?? 'en-us' const baseFileName = `${baseLocale}.json` const baseLocalePath = path.join(__dirname, '../src/renderer/src/i18n/locales', baseFileName) @@ -107,15 +106,10 @@ const main = async () => { if (!fs.existsSync(baseLocalePath)) { throw new Error(`${baseLocalePath} not found.`) } - const localeFiles = fs + const files = fs .readdirSync(localesDir) .filter((file) => file.endsWith('.json') && file !== baseFileName) .map((filename) => path.join(localesDir, filename)) - const translateFiles = fs - .readdirSync(translateDir) - .filter((file) => file.endsWith('.json') && file !== baseFileName) - .map((filename) => path.join(translateDir, filename)) - const files = [...localeFiles, ...translateFiles] let count = 0 const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic)