Bitcointalk · Bitcoin client and website translation

中本聪,2010 年 2 月 17 日

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

阅读语言
中文译文

我更新了 SVN,加入了翻译支持。可翻译的字符串全部用 _("") 包裹,所有平台都使用 UTF-8。

程序运行时,会在 EXE 所在目录找文件:locale\\LC_MESSAGES\bitcoin.mo

是你的操作系统语言的两字母代码,譬如 "de" 或 "nl"。

在 Linux 上,它还会找: /usr/share/locale//LC_MESSAGES/bitcoin.mo /usr/local/share/locale//LC_MESSAGES/bitcoin.mo (Linux 上还有其他应该查找的标准位置吗?)

这里是用 poedit 快速制作 .po 和 .mo 文件的步骤:

- 从 SVN 下载 bitcoin 源码 - 在 trunk 目录里 mkdir locale\\LC_MESSAGES - 在 poedit 里,File->New catalog->Paths 标签页 - 点击 "New item" 虚线矩形按钮 - 填入 "../../.." 并务必按回车确认添加路径 - 点击 OK - 把文件保存为你建的 LC_MESSAGES 目录里的 "bitcoin.po" - 然后它会扫描源码,找到大约 170 个字符串 - 如果什么都没找到,检查 Catalog->Settings->Path 标签页,确认 "../../.." 已添加

翻译完成后,同时提交 bitcoin.po(可编辑的目录文件)和 bitcoin.mo(程序使用的编译后数据)。

ORIGINAL · 英文原文
I updated the SVN with changes to support translation.  Translatable strings are all enclosed in _(""), and we're using UTF-8 on all platforms.

When the program runs, it looks in the directory of the EXE for the file: locale\<langcode>\LC_MESSAGES\bitcoin.mo

<langcode> is the two letter code of the language your OS is set to, like "de" or "nl".

On Linux, it also looks for:
/usr/share/locale/<langcode>/LC_MESSAGES/bitcoin.mo
/usr/local/share/locale/<langcode>/LC_MESSAGES/bitcoin.mo
(are there other standard places it should look on linux?)

Here's a quick walkthrough using poedit to make a .po and .mo file:

- Download the bitcoin sourcecode from SVN
- In the trunk directory, mkdir locale\<lang>\LC_MESSAGES
- In poedit, File->New catalog->Paths tab
- Click the "New item" dotted rectangle button
- Put "../../.." and MAKE SURE TO PRESS ENTER to add the path
- Click OK
- Save the file as "bitcoin.po" in the LC_MESSAGES directory you made
- It should then scan the sourcecode and find about 170 strings
- If it didn't find anything, check Catalog->Settings->Path tab, make sure the "../../.." was added

When you're done translating, commit both bitcoin.po (the editable catalog file) and bitcoin.mo (compiled data used by the program).
上下文
← 上一条 SN-0286 · 当前 下一条 → 在档案中查看完整主题串 →
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-0286