回复:比特币客户端和网站翻译
原始发布页
打开来源页面查看 1 个交叉存档
我更新了 SVN,加入了支持翻译的改动。所有可翻译字符串都包含在 _("") 中,而且我们在所有平台上都使用 UTF-8。
程序运行时,会在 EXE 所在目录中查找这个文件:locale\<langcode>\LC_MESSAGES\bitcoin.mo
<langcode> 是你的操作系统所设置语言的双字母代码,例如 "de" 或 "nl"。
在 Linux 上,它还会查找: /usr/share/locale/<langcode>/LC_MESSAGES/bitcoin.mo /usr/local/share/locale/<langcode>/LC_MESSAGES/bitcoin.mo (在 linux 上还有其他应当查找的标准位置吗?)
下面是使用 poedit 制作 .po 和 .mo 文件的快速操作指南:
- 从 SVN 下载比特币源代码 - 在 trunk 目录中执行 mkdir locale\<lang>\LC_MESSAGES - 在 poedit 中,依次选择 File->New catalog->Paths 选项卡 - 点击“New item”虚线矩形按钮 - 输入 "../../..",并务必按 ENTER 键来添加路径 - 点击 OK - 将文件以 "bitcoin.po" 为名保存在你创建的 LC_MESSAGES 目录中 - 随后它应该会扫描源代码,并找到大约 170 个字符串 - 如果它什么都没找到,请检查 Catalog->Settings->Path 选项卡,确认 "../../.." 已添加
翻译完成后,请同时提交 bitcoin.po(可编辑的目录文件)和 bitcoin.mo(程序使用的已编译数据)。
英文原文
展开英文原文
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).