Bitcointalk

Bitcoin client and website translation

中本聪 · 2010 年 2 月 17 日

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

阅读语言

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

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

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

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

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

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

在 Linux 上,它还会找:

On Linux, it also looks for:

/usr/share/locale//LC_MESSAGES/bitcoin.mo

/usr/share/locale//LC_MESSAGES/bitcoin.mo

/usr/local/share/locale//LC_MESSAGES/bitcoin.mo

/usr/local/share/locale//LC_MESSAGES/bitcoin.mo

(Linux 上还有其他应该查找的标准位置吗?)

(are there other standard places it should look on linux?)

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

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

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

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

When you're done translating, commit both bitcoin.po (the editable catalog file) and bitcoin.mo (compiled data used by the program).

上下文
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-0286

阅读字号

选择适合你的字号,之后阅读会继续使用。