714
edits
Thecyyoung (talk | contribs) Tag: 2017 source edit |
(翻译 Translator documentation) |
||
| Line 13: | Line 13: | ||
{{TemplateMainPageZh}} | {{TemplateMainPageZh}} | ||
= [[File:Language.png]] 翻译 Dolibarr = | =[[File:Language.png]] 翻译 Dolibarr= | ||
Dolibarr的语言文件已经被翻译成多种语言。 | |||
英语是其默认的语言,并且会始终保持完整。其他语言的文档是否完整依赖于自愿者的贡献。 本教程帮助您针对未被翻译或者翻译错误的文档完成语言翻译工作。 | |||
Dolibarr可以用三种不同的方式翻译: | Dolibarr可以用三种不同的方式翻译: | ||
# 手动使用Transifex (官方和推荐的方法) | #手动使用Transifex (官方和推荐的方法) | ||
# 手动编辑语言文件 | #手动编辑语言文件 | ||
# 全自动:自动翻译机 | #全自动:自动翻译机 | ||
== 使用Transifex在线服务进行手动翻译(推荐)== | ==使用Transifex在线服务进行手动翻译(推荐)== | ||
Transifex | Transifex 是一个为翻译项目提供在线平台的Web应用程序。它包括团队和讨论工具、翻译记忆库、词汇表、校对和许多其他功能。 | ||
它非常容易使用,所有翻译都可以通过Web界面或者使用TX客户端终端上传或下载。 | |||
Transifex 是一个开源项目,“社区版”可以免费下载和安装,但我们将使用在线托管服务。 | Transifex 是一个开源项目,“社区版”可以免费下载和安装,但我们将使用在线托管服务。 | ||
=== | ===使用Web界面(针对翻译人员)=== | ||
如果你想帮忙把Dolibarr翻译成自己的语言,请进入该项目的页面 https://www.transifex.com/dolibarr-association/dolibarr/ | |||
然后,您可以注册一个帐户,并请求加入目标语言的项目团队。管理员会接受您的请求,所以请耐心等待。 | |||
一旦被接受,您就可以马上开始翻译了。 | |||
欲了解更多信息,请查阅网站 http://docs.transifex.com/introduction/translators/ 上的Transifex Getting Started(入门)介绍规范和网站 http://docs.transifex.com/tutorials/txeditor/ 上的web editor tutorial(编辑器向导)。 | |||
====''' | ===='''关于 en_US 的备注'''==== | ||
这个Web界面不能用来翻译源代码的en_US语言。 | |||
对en_US语言的任何更改都必须在Dolibarr源代码中完成,并在我们的GitHub存储库上使用Pull Request提交。 | |||
=== 使用TX 命令行客户端 (for Dolibarr [[:Category:Yoda]] team) === | ===使用TX 命令行客户端 (for Dolibarr [[:Category:Yoda]] team)=== | ||
这描述了如何从命令行中使用Transifex。然而,这是保留给Dolibarr管理员用户,以同步Transifex与Dolibarr主源码。 | 这描述了如何从命令行中使用Transifex。然而,这是保留给Dolibarr管理员用户,以同步Transifex与Dolibarr主源码。 | ||
| Line 55: | Line 55: | ||
pip install transifex-client | pip install transifex-client | ||
</source> | </source> | ||
然后你必须初始化你的TX环境。这是通过进入Dolibarr项目根目录运行'tx init ''来完成的。 | 然后你必须初始化你的TX环境。这是通过进入Dolibarr项目根目录运行'tx init ''来完成的。'' | ||
<source lang="bash"> | <source lang="bash"> | ||
cd git/dolibarr | cd git/dolibarr | ||
| Line 88: | Line 88: | ||
</pre></code> | </pre></code> | ||
当前配置文件可以从 https://github.com/Dolibarr/dolibarr/tree/develop/.tx 下载,放入.tx目录,重写由'tx init ''创建的目录。 | 当前配置文件可以从 https://github.com/Dolibarr/dolibarr/tree/develop/.tx 下载,放入.tx目录,重写由'tx init ''创建的目录。'' | ||
此项目配置文件用于将项目的详细信息和文件存储到资源映射。 | 此项目配置文件用于将项目的详细信息和文件存储到资源映射。 | ||
| Line 114: | Line 114: | ||
<nowiki>[dolibarr.resource]</nowiki> | <nowiki>[dolibarr.resource]</nowiki> | ||
source_lang: this is the source language of the resource.<br/> | source_lang: this is the source language of the resource.<br /> | ||
source_file: this points to the source file directly.<br/> | source_file: this points to the source file directly.<br /> | ||
file_filter: here we hold the expression used to identify translation files under the specific project. ''not mandatory''<br/> | file_filter: here we hold the expression used to identify translation files under the specific project. ''not mandatory''<br /> | ||
trans.<lang>: this is used for translation files that don’t follow a common naming schema and the file expression cannot be used to track them. ''not mandatory''<br/> | trans.<lang>: this is used for translation files that don’t follow a common naming schema and the file expression cannot be used to track them. ''not mandatory''<br /> | ||
host: in case the project doesn’t use the default Transifex server as specified in the [main] section, it can override it using this option. ''not mandatory''<br/> | host: in case the project doesn’t use the default Transifex server as specified in the [main] section, it can override it using this option. ''not mandatory''<br /> | ||
====TX 客户端使用==== | ====TX 客户端使用==== | ||
| Line 145: | Line 145: | ||
'''tx pull''' | '''tx pull''' | ||
用于从Transifex服务器将更改拉到您的计算机上<br/> | 用于从Transifex服务器将更改拉到您的计算机上<br /> | ||
TX拉动命令的其他选项是: | TX拉动命令的其他选项是: | ||
<code><pre> | <code><pre> | ||
| Line 174: | Line 174: | ||
</source> | </source> | ||
=== transifex流程的其他问题 === | ===transifex流程的其他问题=== | ||
这是一个简短的Q&A,你也可以问一下transifex翻译过程: | 这是一个简短的Q&A,你也可以问一下transifex翻译过程: | ||
| Line 196: | Line 196: | ||
== 手动翻译(不推荐) == | ==手动翻译(不推荐)== | ||
要将Dolibarr翻译成另一种语言,请转到Langs目录,并创建一个用代码语言命名的文件夹/目录来翻译(遵循现有格式,例如en_US, en_GB, es_ES, de_DE, 等)。然后将文件从现有的语言目录(例如en_US/main.lang, en_GB/bills.lang)复制到刚刚创建的新语言目录中。 | 要将Dolibarr翻译成另一种语言,请转到Langs目录,并创建一个用代码语言命名的文件夹/目录来翻译(遵循现有格式,例如en_US, en_GB, es_ES, de_DE, 等)。然后将文件从现有的语言目录(例如en_US/main.lang, en_GB/bills.lang)复制到刚刚创建的新语言目录中。 | ||
| Line 232: | Line 232: | ||
必须存在或添加到myfile.lang文件。 | 必须存在或添加到myfile.lang文件。 | ||
== 使用autotranslator.php工具自动翻译 == | ==使用autotranslator.php工具自动翻译== | ||
*Translator OS: All | |||
*Tool: '''autotranslator.php''' provided with Dolibarr in directory '''dev/translation'''. | |||
This method is recommended when starting translation for a language not already initialized. If there is already a translation available but you need to add missing key or correct errors, try to use method using Transifex (see later). | This method is recommended when starting translation for a language not already initialized. If there is already a translation available but you need to add missing key or correct errors, try to use method using Transifex (see later). | ||
| Line 252: | Line 253: | ||
Your PHP must also have permissions to write into '''htdocs/langs''' directory and must have curl functions available. | Your PHP must also have permissions to write into '''htdocs/langs''' directory and must have curl functions available. | ||
= [[File:Language.png]] 将你的翻译分发到核心资源中 = | =[[File:Language.png]] 将你的翻译分发到核心资源中= | ||
Once you start translating, it's a smart decision to share it, so it can be included into the official code of Dolibarr. | Once you start translating, it's a smart decision to share it, so it can be included into the official code of Dolibarr. | ||
| Line 268: | Line 269: | ||
If you are developing a new module, you are likely going to need the addition of new language variables. This is done exclusively through the update of the en_US language (htdocs/langs/en_US/ folder). Just modify these files to add the variable you need and send the resulting folder as part of your Pull Request. Refer to the developer documentation to learn how to contribute code (you will need an account on {{TemplateUrlSCM}}. | If you are developing a new module, you are likely going to need the addition of new language variables. This is done exclusively through the update of the en_US language (htdocs/langs/en_US/ folder). Just modify these files to add the variable you need and send the resulting folder as part of your Pull Request. Refer to the developer documentation to learn how to contribute code (you will need an account on {{TemplateUrlSCM}}. | ||
= [[File:Language.png]] 翻译Wiki文档 = | =[[File:Language.png]] 翻译Wiki文档= | ||
维基是用3种语言写成的:英语、法语和西班牙语。 | 维基是用3种语言写成的:英语、法语和西班牙语。 | ||
edits