diff --git a/.github/workflows/auto-i18n.yml b/.github/workflows/auto-i18n.yml index 2dccbd9bb..a6c1e3791 100644 --- a/.github/workflows/auto-i18n.yml +++ b/.github/workflows/auto-i18n.yml @@ -4,6 +4,7 @@ env: TRANSLATION_API_KEY: ${{ secrets.TRANSLATE_API_KEY }} TRANSLATION_MODEL: ${{ vars.AUTO_I18N_MODEL || 'deepseek/deepseek-v3.1'}} TRANSLATION_BASE_URL: ${{ vars.AUTO_I18N_BASE_URL || 'https://api.ppinfra.com/openai'}} + TRANSLATION_BASE_LOCALE: ${{ vars.AUTO_I18N_BASE_LOCALE || 'en-us'}} on: pull_request: diff --git a/scripts/auto-translate-i18n.ts b/scripts/auto-translate-i18n.ts index 7066836fe..71650f661 100644 --- a/scripts/auto-translate-i18n.ts +++ b/scripts/auto-translate-i18n.ts @@ -56,7 +56,7 @@ Performance Optimization Recommendations: - For unstable services: MAX_CONCURRENT_TRANSLATIONS=2, TRANSLATION_DELAY_MS=500 Environment Variables: -- BASE_LOCALE: Base locale for translation (default: 'en-us') +- TRANSLATION_BASE_LOCALE: Base locale for translation (default: 'en-us') - TRANSLATION_BASE_URL: Custom API endpoint URL - TRANSLATION_MODEL: Custom translation model name */ @@ -258,7 +258,7 @@ const main = async () => { 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 baseLocale = process.env.TRANSLATION_BASE_LOCALE ?? 'en-us' const baseFileName = `${baseLocale}.json` const baseLocalePath = path.join(__dirname, '../src/renderer/src/i18n/locales', baseFileName) if (!fs.existsSync(baseLocalePath)) { @@ -284,6 +284,7 @@ const main = async () => { const translateFiles = getFiles(translateDir) const files = [...localeFiles, ...translateFiles] + console.info(`📂 Base Locale: ${baseLocale}`) console.info('📂 Files to translate:') files.forEach((filePath) => { const filename = path.basename(filePath, '.json') diff --git a/scripts/sync-i18n.ts b/scripts/sync-i18n.ts index d20d53b09..4077c5ace 100644 --- a/scripts/sync-i18n.ts +++ b/scripts/sync-i18n.ts @@ -5,7 +5,7 @@ import { sortedObjectByKeys } from './sort' 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 ?? 'zh-cn' +const baseLocale = process.env.TRANSLATION_BASE_LOCALE ?? 'en-us' const baseFileName = `${baseLocale}.json` const baseFilePath = path.join(localesDir, baseFileName)