You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PO文件中源语言与目标语言互换的最佳实践方案咨询

关于PO Edit处理多语言PO文件的最佳实践问题

我负责开发一款支持多GUI语言的解决方案,由于海外开发者并非英语母语人士,原始.pot文件里的英文源文本需要优化为更规范的英式英语(en-GB)版本。

我已经创建了从「en-DEV(原始开发版英文)→ en-GB(规范英式英语)」的PO文件,接下来需要生成以en-GB为源语言、目标语言为空的新PO文件,以此为基础来翻译de-DE、es-ES、fr-FR等其他语言。但处理带复数形式的多条目PO内容时遇到了很大麻烦,比如下面这两种情况:

#: src/login/Login.tsx:133
#, fuzzy
#| msgid "Document is locked for $1"
msgid "Account is locked for $1 minute"
msgid_plural "Account is locked for $1 minutes"
msgstr[0] "Document is locked for $1"
msgstr[1] "Document is locked for $1"

或是更复杂的复数与文本修正场景:

#: src/workflow/workspace/documents/documentsData/functions/deepl-transation/DeeplTranslateModalWindow.tsx:72
msgid ""
"Warning: This document already contain translated text boxes. If you "
"continue, they will be overwritten."
msgid_plural ""
"Warning: This documents already contain translated text boxes. If you "
"continue, they will be overwritten."
msgstr[0] ""
"Warning: This document already contains translated text boxes. If you "
"continue, they will be overwritten."
msgstr[1] ""
"Warning: These documents already contain translated text boxes. If you "
"continue, they will be overwritten."

我之前试过用串联GREP语句来互换源文本和目标文本,但这种方法很不可靠。等其他语言翻译完成后,还需要再次互换en-GB和en-DEV的内容,确保生成的.mo文件能在应用中正常解析。

想请教一下,使用PO Edit编辑器时,有没有可靠的最佳实践方案来处理这类需求?


内容的提问来源于stack exchange,提问作者Kurausu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 05:21:08