翻译文档: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "<keywords content="translation, documentation, translator, localize, localization, i18n, internationalization, language" /> {{Template用户手册}} {{TemplateMainPageZh}} = [[F...")
 
No edit summary
Line 111: Line 111:


====TX 客户端使用====
====TX 客户端使用====
Some useful information on '''tx''' commands.
'''tx''' 命令有用的信息。


'''tx status'''
'''tx status'''


Show status of translations
显示翻译状态


'''tx push'''
'''tx push'''


Used to push changes from your computer to Transifex server<br>
用于推送更改,从你的计算机到Transifex服务器
Additional options for the tx push command are:
 
TX推送命令的其他选项是:
 
<code><pre>
<code><pre>
-h - Shows the help screen for the command
-h - 显示命令行帮助
-l <lang> - Specify which translations you want to push (defaults to all)
-l <lang> - 指定要推送哪些翻译(默认为所有)
-r <resource> - Specify the resource for which you want to push the translations (defaults to all)
-r <resource> - 指定要向其推送翻译的资源(默认为所有)
-f - Push source files without checking modification times
-f - 在不修改修改时间的情况下推送源文件
--skip - Don't stop on errors. Useful when pushing many files concurrently.
--skip - 错误时不要停止。当同时推多个文件时很有用。
-s - Push the source file to the server
-s - 将源文件推送到服务器
-t - Push the translation files to the server
-t - 将翻译文件推送到服务器
--no-interactive - Don't require user input when forcing a push</pre></code>
--no-interactive - 强制推送时不需要用户输入。</pre></code>


'''tx pull'''
'''tx pull'''


Used to pull changes from Transifex server to your computer<br/>
用于从Transifex服务器将更改拉到您的计算机上<br/>
Additional options for the tx pull command are:
TX拉动命令的其他选项是:
<code><pre>
<code><pre>
-h - Shows the help screen for the command
-h - Shows the help screen for the command
Line 146: Line 148:
--minimum_perc=VALUE - Specify the minimum acceptable percentage of a translation in order to download it.</pre></code>
--minimum_perc=VALUE - Specify the minimum acceptable percentage of a translation in order to download it.</pre></code>


'''Examples'''
'''例'''


To pull translation files, you can use:
要取得翻译文档,使用:


<source lang="bash">
<source lang="bash">
Line 155: Line 157:
</source>
</source>


To push source files, just type:
要上传源文件,键入:


<source lang="bash">
<source lang="bash">
Line 163: Line 165:


=== transifex流程的其他问题 ===
=== transifex流程的其他问题 ===
This is short questions and answer you may also ask about transifex translation process:
这是一个简短的Q&A,你也可以问一下transifex翻译过程:


1) Is the sync on a regular time interval ?
1) 是在一个固定的时间间隔上的同步?


No. It is done where there is enough translation submitted. It is also done on a beta branch just before creating the final release package.
不,它是在有足够的翻译提交的地方完成的。在创建最终发布包之前,它也在beta分支上完成。
   
   
2) Are all the translations synced to git, or only the reviewed translations. Do I need to review before sync is done ?
2) 是否所有的翻译同步到Git,或者仅仅是经过审查的翻译。在同步完成之前我需要复习吗? ?


When a Sync is done, transifex files overwrites files into git, but only if there is at least on record modified for the file.
当同步完成时,transifex文件将文件覆盖到Git中,但前提是至少为文件修改了记录。
You don't have to make review before sync is done. Making review is above all to know which lines were manually reviewed and which one were initially translated using a robot.
在同步完成之前,您不必进行复查。最重要的是,要知道哪些线是手工评审的,哪些是最初用机器人翻译的。
   
   
3) In which Dolibarr releases will translations be available ? Are transifex translations also synced to maintenance releases ?
3) Dolibarr发布的版本将有翻译吗?transifex 翻译也与维护版本同步?


Sync is always done on develop and/or beta.
同步总是在开发和/或beta上完成。
So transifex changes appear in all version whose branch is created after the transifex change (a sync is always done before creating a new branch). Once a branch is created, then new changes into transifex will be available only for next branch. Reason of this is that transifex is not able to manage branch/versions (not yet).
因此,transifex更改出现在所有版本中,其分支是在transifex更改之后创建的(在创建新分支之前总是进行同步)。
 
一旦创建了一个分支,那么新的过渡到transifex将只适用于下一个分支。这是因为transifex无法管理分支/版本(还没有)。




Line 184: Line 188:
== 手动翻译(不推荐) ==
== 手动翻译(不推荐) ==


To translate Dolibarr into another language, go to the langs directory and create a folder/directory named with the code language to translate (follow the existing format, for example en_US, en_GB, es_ES, de_DE, etc...). Then copy the files from an existing language directory (for example en_US/main.lang, en_GB/bills.lang), into the new language directory that you have just created.
要将DoiBARR翻译成另一种语言,请转到Langs目录,并创建一个用代码语言命名的文件夹/目录来翻译(遵循现有格式,例如en_US, en_GB, es_ES, de_DE, 等)。然后将文件从现有的语言目录(例如en_US/main.lang, en_GB/bills.lang)复制到刚刚创建的新语言目录中。


These files have the format of key/value pairs in each line like the followings:
这些文件在每行中具有键/值对的格式,如下所示:


<source lang="ini">
<source lang="ini">
Line 194: Line 198:
Coden = translate phrase n
Coden = translate phrase n
</source>
</source>


Translate the phrases (the value portion of the key/value pairs) on right side of the "=" as seen above, the code (the key portion) on left side of "=" should remain unchanged. It is possible to translate the files one by one, without bringing them all at once. If a file has not been translated into the new language, Dolibarr uses English.
Translate the phrases (the value portion of the key/value pairs) on right side of the "=" as seen above, the code (the key portion) on left side of "=" should remain unchanged. It is possible to translate the files one by one, without bringing them all at once. If a file has not been translated into the new language, Dolibarr uses English.


To have a localised (translated) string into the PHP code, all you have to do is load the language file and use the method to get the translated value, like this:
将短语(键值对的值部分)翻译你的语言,“=”的左边的代码(键部分)应该保持不变。
 
可以逐个翻译这些文件,而不必一次就把它们全部翻译出来。
 
如果文件没有被翻译成新的语言,Dolibarr将使用英语。
 
要在PHP代码中有一个本地化的(翻译的)字符串,你所要做的就是加载语言文件并使用该方法得到翻译值,如下所示:


<source lang="php">
<source lang="php">
$langs->load("myfile"); // or use $langs->load("myfile@mymodule") if myfile.lang is inside directory htdocs/mymodule/langs/xx_XX   
$langs->load("myfile"); // or use $langs->load("myfile@mymodule") if myfile.lang is inside directory htdocs/mymodule/langs/xx_XX   


Line 205: Line 217:
</source>
</source>


An entry type;
条目类型;


<source lang="ini">
<source lang="ini">
Line 211: Line 223:
</source>
</source>


must be present or added to the myfile.lang file.
必须存在或添加到myfile.lang文件。




Line 251: Line 263:


= [[File:Language.png]] 翻译Wiki文档 =
= [[File:Language.png]] 翻译Wiki文档 =
The wiki is written in 3 languages: English, French and Spanish.
维基是用3种语言写成的:英语、法语和西班牙语。
 
如果你想增强这些语言中的一种语言,你所要做的就是在Wiki上创建一个帐户。
如果你想增强这些语言中的一种语言,你所要做的就是在Wiki上创建一个帐户。
然后,您可以编辑现有的页面来纠正错误的翻译或翻译等待翻译的页面。 [[:Category:Page_waiting_for_translation]].
然后,您可以编辑现有的页面来纠正错误的翻译或翻译等待翻译的页面。 [[:Category:Page_waiting_for_translation]].
513

edits

Navigation menu