原始文献 / 论坛帖 / Bitcoin client and website translation
Bitcoin client and website translation
Bitcointalk · 2010-02-08 16:10:37 UTC
单个二进制文件加多个 .mo 文件要省心得多。搞一堆构建变体维护工作量太大。软件支持一旦实现,谁都可以贡献翻译。
wxWidgets 用 gettext 标准。你用 gettext 工具或 poedit 之类的,扫描源文件里的字符串生成 .po 文件,把翻译填进去,再编译成 .mo 文件。程序运行时加载 .mo 文件,给所有字符串换皮。加新语言不用重新编译程序,加 .mo 文件就行。
在 Windows 上,.mo 文件放在 EXE 所在目录下的 lang 子目录。
我现在在做 JSON-RPC 和命令行支持,做完希望接下来做这个。
英文原文
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.
