翻譯文檔
[[ :]]
[[:]]
[[:]]
[[:]]
[[ Links below will be automatically replicated on translated pages by PolyglotBot -->:]]
[[:]]
[[= Translate documentation on wiki=]]
Dolibarr-Sprachdateien sind bereits in mehrere Sprachen übersetzt.:
Englisch ist die Standardeinstellung und immer vollständig. Andere Sprachen sind von Beiträgen abhängig. Dieses Tutorial kann Ihnen helfen, eine Übersetzung für eine Sprache zu erstellen, die noch nicht verfügbar oder irgendwie falsch ist.:
Dolibarr kann mit drei verschiedenen Mitteln übersetzt werden:
#Manually using Transifex (Official and recommended method).:
#Manually editing language files:
#Completely automatic: autotranslator
==Manual Translation using Transifex online service (recommended)==:
Transifex is a web application that provides an online platform for translation projects. It includes teams and discussion tools, translation memory, glossary, proofreading and a lot of other features.:
It is quite easy to use and all translations can be uploaded and downloaded through the web interface or using their TX client from a terminal.:
Transifex is an open source project and the "community edition" can be freely downloaded and installed, but we will use the online hosted service.:
===Using the web interface (for translators)===:
If you want to help to translate Dolibarr in your own language, check the project's page at https://www.transifex.com/dolibarr-association/dolibarr/
You can then register an account and request joining the project team for the language(s) you're targeting. A manager will have to accept your request, so please be patient.:
Once accepted, you can start translating right away.:
For more information, please check Transifex "Getting Started" introduction at http://docs.transifex.com/introduction/translators/ and the web editor tutorial at http
''' Note about en_US ''':
The web interface can not be used to translate the en_US language which is source.:
Any change for en_US language must be done in Dolibarr source code and submitted using a Pull Request on our GitHub repository.:
[[===Using TX command line client (for Dolibarr Category
This describes how to use Transifex from the command line. However, this is reserved to Dolibarr admin users to synchronize Transifex with Dolibarr main sources.:
[[More information can also be found on the Transifex Official documentation]
====TX Client configuration====:
First install TX Client.:
With Debian/Ubuntu/Mint:
[[
:]]
[[apt-get install python-pip:]]
[[pip install transifex-client:]]
[[
:]]
Then you have to initialize your TX environment. This is done by running '''tx init''' into dolibarr project root directory.: cd git/dolibarr: tx init: Accept to overwrite config file. Keep default value for Transifex instance, then enter your Transifex login and password.: After this, a .transifexrc has been created into your HOME dir and a generic config file has been created as '''.tx/config''' in project's root.: So your directory's contents will look like that:
[[
:]]
[[.:]]
[[|-- build:]]
[[|-- build.xml:]]
[[|-- ChangeLog:]]
[[|-- COPYING:]]
[[|-- COPYRIGHT:]]
[[|-- dev:]]
[[|-- doc:]]
[[|-- .gitignore:]]
[[|-- htdocs:]]
[[|-- INSTALL:]]
[[|-- pom.xml:]]
[[|-- quickbuild.xml:]]
[[|-- README:]]
[[|-- README-FR:]]
[[|-- README.md:]]
[[|-- robots.txt:]]
[[|-- scripts:]]
[[|-- test:]]
[[`-- .tx:]]
[[
:]]
The current config file can be downloaded from https://github.com/Dolibarr/dolibarr/tree/develop/.tx , put it into .tx directory, overwriting the one created by '''tx init''' This project configuration file is used to store the project’s details and the file-to-resource mappings.: That is a sample of what the config file contains:
[[
:]]
[[main:]]
[[host = https://www.transifex.com]]
[[lang_map = uz: uz_UZ]]
[[dolibarr.admin:]]
[[file_filter = htdocs/langs/<lang>/admin.lang:]]
[[source_file = htdocs/langs/en_US/admin.lang:]]
[[source_lang = en_US:]]
[[type = MOZILLAPROPERTIES:]]
[[Here is an explanation of the sections and options used in the config file:]]
[[<nowiki>[main] section</nowiki>:]]
[[In this section, we have project-wide options, such as the default transifex host for all projects. These can be overridden by each resource, in case it is needed.:]]
[[<nowiki>[dolibarr.resource]</nowiki>:]]
[[source_lang: this is the source language of the resource.<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 />]]
[[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 />]]
[[====TX Client use====:]]
[[Some useful information on '''tx''' commands.:]]
[['''tx status''':]]
[[Show status of translations:]]
[['''tx push''':]]
[[Used to push changes from your computer to Transifex server<br>:]]
[[Additional options for the tx push command are:]]
[[-h - Shows the help screen for the command:]]
[[-l <lang> - Specify which translations you want to push (defaults to all):]]
[[-r <resource> - Specify the resource for which you want to push the translations (defaults to all):]]
[[-f - Push source files without checking modification times:]]
[[--skip - Don't stop on errors. Useful when pushing many files concurrently.:]]
[[-s - Push the source file to the server:]]
[[-t - Push the translation files to the server:]]
[[--no-interactive - Don't require user input when forcing a push</pre></code>:]]
[['''tx pull''':]]
[[Used to pull changes from Transifex server to your computer<br />:]]
[[Additional options for the tx pull command are:]]
[[-l <lang> - Specify which translations you want to pull (defaults to all):]]
[[-r <resource> - Specify the resource for which you want to pull the translations (defaults to all):]]
[[-a - Fetch all translation files from the server (even new ones):]]
[[-s - Force the fetching of the source file (default: False)]]
[[-f - Force download of translations files:]]
[[--disable-overwrite - By default Transifex will fetch new translations files and replace existing ones. Use this flag if you want to disable this feature.:]]
[[--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:]]
[[tx -d pull -l it_IT # Get italian language only:]]
[[tx -d pull -a # Get all languages:]]
[[To push source files, just type:]]
[[tx -d push -t -l it_IT [-r dolibarr.file] # To push only a specific translation file:]]
[[tx -d push -s # To push source file:]]
[[===Other questions on transifex process===:]]
[[This is short questions and answers you may also ask about transifex translation process:]]
[[1) Is the sync on a regular time interval?:]]
[[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.:]]
[[ :]]
[[2) Are all the translations synced to git or only the reviewed translations? Do I need to review before sync is done?:]]
[[When a Sync is done, transifex files overwrites files into git, but only if there is at least on record modified for the file. :]]
[[You don't have to make a review before sync is done. Making review is above all to know which lines were manually reviewed and which one was initially translated using a robot.:]]
[[3) In which Dolibarr releases will translations be available? Are transifex translations also synced to maintenance releases?:]]
[[Sync is always done on develop and/or 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, the new changes into transifex will be available only for the next branch. The reason for this is that transifex is not able to manage branch/versions (not yet).:]]
[[==Manual Translation (not recommended)==:]]
[[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.:]]
[[These files have the format of key/value pairs in each line like the followings:]]
[[Code1 = translate phrase 1:]]
[[Code2 = translate phrase 2:]]
[[...:]]
[[Coden = translate phrase n:]]
[[Translate the phrases (the value portion of the key/value pairs) on the right side of the "=" as seen above, the code (the key portion) on the 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:]]
[[<source lang="php">:]]
[[$langs->load("myfile"); // or use $langs->load("myfile@mymodule") if myfile.lang is inside directory htdocs/mymodule/langs/xx_XX :]]
[[print $langs->trans("CodeX"):]]
[[An entry type;:]]
[[CodeX = phrase X:]]
[[must be present or added to the myfile.lang file.:]]
[[==Automatic Translation with autotranslator.php tool==:]]
[[*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 a missing key or correct errors, try to use method using Transifex (see later).:]]
[[To make or update all files of a language code, just run the script:]]
[[php autotranslator.php lang_code_source lang_code_target GOOGLEAPIKEY:]]
[[For example :]]
[[php autotranslator.php en_US pt_PT GOOGLEAPIKEY:]]
[[to translate into Portuguese (pt_PT) using English (en_US) files.:]]
[[All nonexisting files will be created, all existing files will be updated.:]]
[[The tool use [http://translate.google.com Google translation] service to find the translation value of a string, so a working Internet connection is required from station running the script. Also, a GOOGLEAPIKEY is required and Google charges a fee for using this service (20 euros / 1 000 000 of translated chars).]]
[[Your PHP must also have permissions to write into '''htdocs/langs''' directory and must have curl functions available.:]]
[[Once you start translating, it's a smart decision to share it, so it can be included in the official code of Dolibarr.:]]
[[If you keep it for you, others will not be able to improve it when new terms are added or previous terms are modified, and you will still have to manage the translation on your own.:]]
[[If you translated through the Transifex system, there's nothing to be done. Your translation will be included in the next version of Dolibarr. No additional work! In technical terms, the translation will be exported from Transifex and imported into Dolibarr by our developers, at least once every month.:]]
[[If, however, you translated directly in Dolibarr files, then you will first have to transfer those translations to Transifex before they can be included. So, really, you should start translating into Transifex.:]]
[[If you send us your translation through a Pull Request on Github, sadly, it will be overwritten by the next import from Transifex, so it would be very short-lived.:]]
[[Note:]]
[[The reference language is en_US and is always complete. You can find it in the htdocs/langs/en_US/ folder. All other language files are likely to be slightly or highly incomplete, depending on the language.:]]
[[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}}.:]]
[[The wiki is written in 3 languages: English, French, and Spanish.]]
[[If you want to enhance documentation on one of these languages, all you have to do is to create an account on this wiki.:]]
[[Then, you can edit existing pages to correct a bad translation or translate pages waiting for translation [[:Category]]
[[<br />:]]
[[=== How to translate an existing page ? ===:]]
[[==== Create a new page for the translated version. ====:]]
[[Start by creating a new page for the translated version. To do this, you can access an non existant URL : for example [[Translator documentation|<code>https]]
[[The chosen title for the translated version of the page should be the translation of the title of the original English page.:]]
[[==== Linking your new page to the original English page. ====:]]
[[To add a link to your newly created page on the original English page, you must edit it using the '''Edit wikicode''' (not the visual editor).:]]
[[On the top of the page, search for a block that look like :]]
[[<source>:]]
<!-- END interlang links -->
<seo metak="translation, documentation, translator, localize, localization, i18n, internationalization, language" />
{{Template用户手册}}
{{TemplateMainPageZh}}
= [[File:Language.png]] 翻译 Dolibarr =
Dolibarr语言文件已经用几种语言翻译了。
英语是默认的语言会首先完成翻译。其他语言依赖于自愿者的贡献。 本教程帮助您完成一个未译的或错译的语言。
Dolibarr可以用三种不同的方式翻译:
# 手动使用Transifex (官方和推荐的方法)
# 手动编辑语言文件
# 全自动:自动翻译机
== 使用Transifex在线服务进行手动翻译(推荐)==
Transifex 是一个为翻译项目提供在线平台的Web应用程序。它包括团队和讨论工具、翻译记忆、词汇表、校对和许多其他特征。
它非常容易使用,所有翻译都可以通过Web界面上传或下载,或者使用来自终端的TX客户端。
Transifex 是一个开源项目,“社区版”可以免费下载和安装,但我们将使用在线托管服务。
===使用Web界面(译者)===
如果你想用自己的语言帮助翻译Dolibarr,请检查项目的页面。 https://www.transifex.com/dolibarr-association/dolibarr/
然后,您可以注册一个帐户,并请求加入项目团队,以您的语言为目标。管理员会接受你的要求,所以请耐心等待。
一旦被接受,你就可以马上开始翻译了。
欲了解更多信息,请检查Transifex“入门”介绍规范 http://docs.transifex.com/introduction/translators/ 和网络编辑器向导于 http://docs.transifex.com/tutorials/txeditor/
===='''备注关于 en_US'''====
Web界面不能用来翻译源代码的en_US语言。
任何更改都必须在Dolibarr源代码中完成,并在GitHub存储库上使用Pull请求提交。
=== 使用TX 命令行客户端 (for Dolibarr [[:Category:Yoda]] team) ===
这描述了如何从命令行中使用Transifex。然而,这是保留给Dolibarr管理员用户,以同步Transifex与Dolibarr主源码。
[http://docs.transifex.com/developer/client/ 官方文档]
====TX 客户端设置====
安装 TX 客户端
使用 Debian/Ubuntu/Mint:
<source lang="bash">
apt-get install python-pip
pip install transifex-client
然後你必須初始化你的TX環境。這是通過進入Dolibarr項目根目錄運行'tx init 來完成的。
cd git/dolibarr
tx init
接受改寫配置文件。保持Transifex實例的默認值,然後輸入您的Transifex登錄和密碼。
在此之後,一個.transifexrc已經創建到您的主頁目錄,並且一個通用配置文件被創建於項目根目錄中的.tx/config。 所以目錄的內容會是這樣的: 所以目錄的內容會是這樣的:
.
|-- build
|-- build.xml
|-- ChangeLog
|-- COPYING
|-- COPYRIGHT
|-- dev
|-- doc
|-- .gitignore
|-- htdocs
|-- INSTALL
|-- pom.xml
|-- quickbuild.xml
|-- README
|-- README-FR
|-- README.md
|-- robots.txt
|-- scripts
|-- test
`-- .tx
當前配置文件可以從 https://github.com/Dolibarr/dolibarr/tree/develop/.tx 下載,放入.tx目錄,重寫由'tx init 創建的目錄。
此項目配置文件用於將項目的詳細信息和文件存儲到資源映射。
這是配置文件包含內容的示例:
[main]
host = https://www.transifex.com
lang_map = uz: uz_UZ
[dolibarr.admin]
file_filter = htdocs/langs/<lang>/admin.lang
source_file = htdocs/langs/en_US/admin.lang
source_lang = en_US
type = MOZILLAPROPERTIES
下面是配置文件中使用的部件和選項的說明:
[main] section
在本節中,我們有項目範圍的選項,例如:所有項目的默認transifex主機。如果需要的話,這些資源可以被每個資源重寫。
[dolibarr.resource]
source_lang: this is the source language of the resource.
source_file: this points to the source file directly.
file_filter: here we hold the expression used to identify translation files under the specific project. not mandatory
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
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
TX 客戶端使用
tx 命令有用的信息。
tx status
顯示翻譯狀態
tx push
用於推送更改,從你的計算機到Transifex服務器
TX推送命令的其他選項是:
-h - 显示命令行帮助
-l <lang> - 指定要推送哪些翻译(默认为所有)
-r <resource> - 指定要向其推送翻译的资源(默认为所有)
-f - 在不修改修改时间的情况下推送源文件
--skip - 错误时不要停止。当同时推多个文件时很有用。
-s - 将源文件推送到服务器
-t - 将翻译文件推送到服务器
--no-interactive - 强制推送时不需要用户输入。
tx pull
用於從Transifex服務器將更改拉到您的計算機上
TX拉動命令的其他選項是:
-h - Shows the help screen for the command
-l <lang> - Specify which translations you want to pull (defaults to all)
-r <resource> - Specify the resource for which you want to pull the translations (defaults to all)
-a - Fetch all translation files from server (even new ones)
-s - Force the fetching of the source file (default: False)
-f - Force download of translations files
--skip - Don't stop on errors. Useful when pushing many files concurrently.
--disable-overwrite - By default Transifex will fetch new translations files and replace existing ones. Use this flag if you want to disable this feature.
--minimum_perc=VALUE - Specify the minimum acceptable percentage of a translation in order to download it.
例
要取得翻譯文檔,使用:
tx -d pull -l it_IT # Get italian language only
tx -d pull -a # Get all languages
要上傳源文件,鍵入:
tx -d push -t -l it_IT [-r dolibarr.file] # To push only a specific translation file
tx -d push -s # To push source file
transifex流程的其他問題
這是一個簡短的Q&A,你也可以問一下transifex翻譯過程:
1) 是在一個固定的時間間隔上的同步?
不,它是在有足夠的翻譯提交的地方完成的。在創建最終發布包之前,它也在beta分支上完成。
2) 是否所有的翻譯同步到Git,或者僅僅是經過審查的翻譯。在同步完成之前我需要複習嗎? ?
當同步完成時,transifex文件將文件覆蓋到Git中,但前提是至少為文件修改了記錄。 在同步完成之前,您不必進行複查。最重要的是,要知道哪些線是手工評審的,哪些是最初用機器人翻譯的。
3) Dolibarr發布的版本將有翻譯嗎?transifex 翻譯也與維護版本同步?
同步總是在開發和/或beta上完成。 因此,transifex更改出現在所有版本中,其分支是在transifex更改之後創建的(在創建新分支之前總是進行同步)。
一旦創建了一個分支,那麼新的過渡到transifex將只適用於下一個分支。這是因為transifex無法管理分支/版本(還沒有)。
手動翻譯(不推薦)
要將DoiBARR翻譯成另一種語言,請轉到Langs目錄,並創建一個用代碼語言命名的文件夾/目錄來翻譯(遵循現有格式,例如en_US, en_GB, es_ES, de_DE, 等)。然後將文件從現有的語言目錄(例如en_US/main.lang, en_GB/bills.lang)複製到剛剛創建的新語言目錄中。
這些文件在每行中具有鍵/值對的格式,如下所示:
Code1 = translate phrase 1
Code2 = translate phrase 2
...
Coden = translate phrase n
將短語(鍵值對的值部分)翻譯你的語言,「=」的左邊的代碼(鍵部分)應該保持不變。
可以逐個翻譯這些文件,而不必一次就把它們全部翻譯出來。
如果文件沒有被翻譯成新的語言,Dolibarr將使用英語。
要在PHP代碼中有一個本地化的(翻譯的)字符串,你所要做的就是加載語言文件並使用該方法得到翻譯值,如下所示:
$langs->load("myfile"); // or use $langs->load("myfile@mymodule") if myfile.lang is inside directory htdocs/mymodule/langs/xx_XX
print $langs->trans("CodeX")
條目類型;
CodeX = phrase X
必須存在或添加到myfile.lang文件。
使用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).
To make or update all files of a language code, just run the script:
php autotranslator.php lang_code_source lang_code_target GOOGLEAPIKEY
For example :
php autotranslator.php en_US pt_PT GOOGLEAPIKEY
to translate into Portuguese (pt_PT) using English (en_US) files.
All non existing files will be created, all existing files will be updated. The tool use Google translation service to find the translation value of a string, so a working Internet connection is required from station running the script. Also a GOOGLEAPIKEY is required and Google charges a fee for using this service (20 euros / 1 000 000 of translated chars). Your PHP must also have permissions to write into htdocs/langs directory and must have curl functions available.
將你的翻譯分發到核心資源中
Once you start translating, it's a smart decision to share it, so it can be included into the official code of Dolibarr. If you keep it for you, others will not be able to improve it when new terms are added or previous terms are modified, and you will still have to manage the translation on your own.
If you translated through the Transifex system, there's nothing to be done. Your translation will be included in the next version of Dolibarr. No additional work! In technical terms, the translation will be exported from Transifex and imported into Dolibarr by our developers, at least once every month.
If, however, you translated directly in Dolibarr files, then you will first have to transfer those translations to Transifex before they can be included. So, really, you should start translating into Transifex. If you send us your translation through a Pull Request on Github, sadly, it will be overwritten by the next import from Transifex, so it would be very short-lived.
Note:
The reference language is en_US and is always complete. You can find it in the htdocs/langs/en_US/ folder. All other language files are likely to be slightly or highly incomplete, depending on the language.
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 https://github.com/Dolibarr/dolibarr.
翻譯Wiki文檔
維基是用3種語言寫成的:英語、法語和西班牙語。
如果你想增強這些語言中的一種語言,你所要做的就是在Wiki上創建一個帳戶。
然後,您可以編輯現有的頁面來糾正錯誤的翻譯或翻譯等待翻譯的頁面。 Category:Page_waiting_for_translation.