feat(i18n): add Simplified Chinese and German language support

Add 'zh-cn' and 'de-de' to language map and log system prompt for debugging
This commit is contained in:
icarus 2025-10-23 15:54:02 +08:00
parent 74eb3141cd
commit e1aa223e5d

View File

@ -27,6 +27,7 @@ const openai = new OpenAI({
})
const languageMap = {
'zh-cn': 'Simplified Chinese',
'en-us': 'English',
'ja-jp': 'Japanese',
'ru-ru': 'Russian',
@ -34,7 +35,8 @@ const languageMap = {
'el-gr': 'Greek',
'es-es': 'Spanish',
'fr-fr': 'French',
'pt-pt': 'Portuguese'
'pt-pt': 'Portuguese',
'de-de': 'German'
}
const PROMPT = `
@ -137,6 +139,8 @@ const main = async () => {
}
const systemPrompt = PROMPT.replace('{{target_language}}', languageMap[filename])
console.info('System Prompt: ', systemPrompt)
const result = await translateRecursively(targetJson, systemPrompt)
count += 1
bar.update(count)