Bitcointalk · Bitcoin client and website translation

中本聪,2010 年 2 月 8 日

SN-0277 已核对来源,附原文与上下文。

阅读语言
中文译文

单一二进制加多个 .mo 文件容易得多。维护一大堆构建变体太费事。软件支持一旦实现,任何人都能贡献翻译。

wxWidgets 用的是 gettext 标准。用 gettext 工具或 poedit 之类,扫描源文件提取字符串生成 .po 文件,把译文填进去,再编译成 .mo 文件。程序在运行时加载 .mo 文件,给所有字符串换皮。给现有程序加语言只需加 .mo 文件,无需重新编译。

在 Windows 上,.mo 文件放在 EXE 所在目录的 lang 子目录里。

现在我在做 JSON-RPC 和命令行支持,完成后希望接下来就做这个。

ORIGINAL · 英文原文
It's much easier to have a single binary and multiple .mo files.  It's too much maintenance work to have lots of build variations.  Once the software support is implemented, anyone could contribute translations.

wxWidgets uses the gettext standard.  You use the gettext tools or something like poedit to create a .po file by scanning the sourcefiles for strings and editing the translations into the .po file, then compile it into a .mo file.  The program loads the .mo file at runtime and reskins all the strings.  Additional languages can be added to an existing program by adding .mo files without recompiling the program.

On Windows, the .mo files would go in a lang subdirectory in the directory where the EXE is located.

Right now I'm working on JSON-RPC and command line support, but when I'm finished with that I hope to do this next.
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-0277