如何帮助翻译本网站
网站的翻译是使用 .po 文件完成的。 最简单的方法是在Transifex请求加入翻译团队。 或者,也可以按照下面概述的“旧方式”完成。
-
Preparation
- Come to #i2p-dev on irc and talk to people. Claim the language - To make sure other coworkers don't bump onto the files you are working on, please update the translation status on this wiki page.
- Follow the new developer's guide, including the installation of git and the gettext tools. You will need the i2p.www repository. It is not required that you sign a dev agreement.
- Create files:
If the file for your language does not exist yet:
- Run "
./extract-messages.sh
" to generate amessages.pot
in the base directory. Edit the header of this file, then run "./init-new-po.sh locale
" to generate the filei2p2www/translations/locale/LC_MESSAGES/messages.po
. "mtn add
" this file. - Edit
i2p2www/pages/global/lang.html
and add a line for your language (copy an existing line). - Add a flag image file to
i2p2www/static/images/flags/
for the menu (copy from the router).
- Run "
- Edit files:
Edit
i2p2www/translations/locale/LC_MESSAGES/messages.po
. To work with .po files efficiently, you may wish to use POEdit - Git Workflow:
You can then add all new and changed files to your next commit using
git add .
(or specify which files instead of the dot). Please note the suggested workflow for git on our git-page. - Repeat. Check in often. Don't wait until it is perfect.
如何帮助翻译路由控制台
最简单的方法还是在 Transifex请求加入翻译团队。 或者,也可以按照下面概述的“旧方式”完成。
-
Preparation
- Come to #i2p-dev on irc and talk to people. Claim the language - To make sure other coworkers don't bump onto the files you are working on, please update the translation status on this wiki page.
- Follow the new developer's guide, including the installation of git and the gettext tools. You will need the i2p.i2p repository.
- Generate your own gpg key and sign the dev agreement.
- 在开始控制台翻译之前,最好先帮助翻译一些 i2p 网页。 至少有一个属于你的语言的 i2p 主页会很棒。
- 有哪些文件需要翻译:
在 i2p.i2p 分支里有15个文件需要翻译:
-
installer/resources/readme/readme_xx.html
-
installer/resources/initialNews/initialNews_xx.xml
-
apps/routerconsole/locale/messages_xx.po
-
installer/resources/proxy/*_xx.ht
(about 9 files) -
apps/routerconsole/jsp/help_xx.jsp
-
installer/resources/I2P Site.help/help/index_xx.html
-
apps/i2ptunnel/locale/messages_xx.po
-
apps/i2psnark/locale/messages_xx.po
-
apps/susidns/locale/messages_xx.po
-
- Create files:
If the file for your language does not exist yet, copy another language file to a new file
foo_xx.bar
for your language. Then "mtn add
" the file. After creating a .po file, edit the headers. Then run "ant distclean poupdate
". - Start to work: Edit the HTML files with any text editor. Be sure not to use an editor in HTML mode that reformats everything. To work with .po files efficiently, you may wish to use POEdit
- Git Workflow:
You can then add all new and changed files to your next commit using
git add .
(or specify which files instead of the dot). Please note the suggested workflow for git on our git-page. - Repeat. Check in often. Don't wait until it is perfect.
As you can see, it's not that difficult.
If you have questions about the meaning of the terms in the console, ask in #i2p-dev
on IRC.
常见问题
Q: Why do I have to install git, Java, jsp, learn about .po files and html, etc.? Why can't I just do a translation and email it to you?
A: You do not / Several reasons:
- First of all: you don't have to, you can translate via Transifex (aka "using a web-site to translate"). Request to join a translation team here. Aside from that ...
- We don't have anybody who has time to accept manual contributions and submit them to our source control system on your behalf. Even if we did, it doesn't scale.
- Maybe you are thinking translation is a one-step process. It isn't. You can't do it all at once. You will make mistakes. You need to test it and tweak it to make it look right before you submit it. Developers will update or add to the English text, thus requiring a translation update.
- Having translators use a source control system directly provides authentication and accountablility - we know who is doing what, and we can track changes, and revert them if necessary.
- .po files are not difficult. If you don't want to work directly with them, we recommend 'poedit'.
- HTML files are not difficult. Just ignore the html stuff and translate the text.
- Installing and using git is not that difficult. Several of the translators and other contributors to I2P are non-programmers, and they use git regularly. Git is simply a source control system, it is not about "coding".
- 我们要翻译的项目不是“文档”, 它们是 html 文件和 po 文件,有必须保持的特定格式和字符编码 (UTF-8),并不会被电子邮件等递交方式损坏格式。
- We looked at 'pootle' as a front-end for translators. It didn't work well, needed an administrator, and a pootle-based process would suffer from a number of the above flaws.
In summary: Yes, we know it is somewhat of a hurdle to get started. It's really the only possible way we can do it. Give it a try, it really isn't that hard.
更多信息
The #i2p-dev channel on IRC, or the translation forum on zzz.i2p.