No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
This page explains how to set up Transifex for use with your document. | This page explains how to set up Transifex for use with your document. | ||
==Step 1: Create an | ==Step 1: Create an Account on Transifex.net== | ||
Go to https://www.transifex.net/ and click on ''Register'' in the top right hand corner to create an account. | Go to https://www.transifex.net/ and click on ''Register'' in the top right hand corner to create an account. | ||
==Step 2: Install the Transifex | ==Step 2: Install the Transifex Client== | ||
To use Transifex with your git repository, you need the <code>transifex-client</code> package installed from the Fedora repositories. | To use Transifex with your git repository, you need the <code>transifex-client</code> package installed from the Fedora repositories. | ||
==Step 3: Configure transifexrc== | ==Step 3: Configure .transifexrc== | ||
Edit the file ~/.transifexrc, adding your Transifex.net username and password in the following format: | Edit the file ~/.transifexrc, adding your Transifex.net username and password in the following format: | ||
Line 29: | Line 29: | ||
</pre> | </pre> | ||
==Step 4: Initialize Transifex in | ==Step 4: Initialize Transifex in Your Git Repository== | ||
Go to the git repository of your document and change to the current Fedora release branch. Alternatively, you can create a new branch specifically for translations by branching the release branch, and then periodically merge updated content from the release branch to the branch with translations. After choosing the approach that is appropriate for you and changing to the branch, enter the following commands, replacing <code><url></code> with the url of your document's project page on Transifex.net: | Go to the git repository of your document and change to the current Fedora release branch. Alternatively, you can create a new branch specifically for translations by branching the release branch, and then periodically merge updated content from the release branch to the branch with translations. After choosing the approach that is appropriate for you and changing to the branch, enter the following commands, replacing <code><url></code> with the url of your document's project page on Transifex.net: | ||
Line 44: | Line 44: | ||
{{admon/tip|I can't find my document on Transifex.net!|Most Fedora documents already have a project page on Transifex.net, but if your document is new you may need to set one up. Ask on the Fedora Docs Project mailing list for help with how to do this.}} | {{admon/tip|I can't find my document on Transifex.net!|Most Fedora documents already have a project page on Transifex.net, but if your document is new you may need to set one up. Ask on the Fedora Docs Project mailing list for help with how to do this.}} | ||
==Step 5: Map | ==Step 5: Map Language Codes== | ||
If you have translation folders already in your repository, you may need to map the language codes to the ones used by Transifex.net, if they are different. | If you have translation folders already in your repository, you may need to map the language codes to the ones used by Transifex.net, if they are different. | ||
Line 77: | Line 77: | ||
</pre> | </pre> | ||
==Step 7: Pushing | ==Step 7: Pushing and Pulling Translations== | ||
Your document repository should now be configured for Transifex! Whenever a change is made to your document, use the following commands to push the changes to Transifex.net so that translators can translate them: | Your document repository should now be configured for Transifex! Whenever a change is made to your document, use the following commands to push the changes to Transifex.net so that translators can translate them: | ||
Line 97: | Line 97: | ||
<pre> | <pre> | ||
tx pull | tx pull -a | ||
</pre> | </pre> | ||
Line 105: | Line 105: | ||
{{admon/tip|Translation Notifications|Make sure you select the ''Watch'' button on your document's Transifex.net project page to receive email notifications when new translations are available. The ''Watch'' button is located below the document's title.}} | {{admon/tip|Translation Notifications|Make sure you select the ''Watch'' button on your document's Transifex.net project page to receive email notifications when new translations are available. The ''Watch'' button is located below the document's title.}} | ||
==Step 8: Branching and Updating Translations Before a New Release== | |||
First, change to the branch intended for the previous Fedora release. Then create a new branch for the upcoming release and change to the branch: | |||
<pre> | |||
git checkout -b <newbranch> | |||
</pre> | |||
Assuming that the content development for the upcoming release happened in the master branch, which is different from the release branch, you should merge the updates from the master branch: | |||
<pre> | |||
git merge master | |||
</pre> | |||
After successful merging, check that the resource configuration in the <code>.tx/config</code> file is still up-to-date and applies to the current documentation. Especially pay attention to changed, moved or removed chapters in your document. If you need to remove an unused resource, run the following command: | |||
<pre> | |||
tx delete -r <documentation>.<resource> | |||
</pre> | |||
For example, if you want to remove the resource Amateur_Radio from the Fedora Release Notes, execute the following command: | |||
<pre> | |||
tx delete -r fedora-release-notes.Amateur_Radio | |||
</pre> | |||
{{admon/tip|Use the development version|As of September 2011, you need to have the development version of <code>transifex-client</code> installed to use the <code>tx delete</code> command. Refer to http://help.transifex.net/user-guide/client/devel.html#development-version for instructions on how to get the development version.}} | |||
When you are done with all necessary changes, follow the usual procedure with pushing and pulling translations that is described in the previous step. | |||
{{admon/tip|Getting more help|Transifex.net has its own comprehensive documentation for <code>transifex-client</code> at http://help.transifex.net/user-guide/client/index.html. You can also post questions to the Docs Project mailing list or ask in the #fedora-docs IRC channel if you get stuck. The L10N Guide has lots of useful information on using Transifex from a translator's perspective: https://fedoraproject.org/wiki/L10N/Guide.}} | {{admon/tip|Getting more help|Transifex.net has its own comprehensive documentation for <code>transifex-client</code> at http://help.transifex.net/user-guide/client/index.html. You can also post questions to the Docs Project mailing list or ask in the #fedora-docs IRC channel if you get stuck. The L10N Guide has lots of useful information on using Transifex from a translator's perspective: https://fedoraproject.org/wiki/L10N/Guide.}} | ||
[[Category:Docs Project process]] | [[Category:Docs Project process]] |
Revision as of 00:33, 4 September 2011
Introduction
The Fedora Project uses Transifex, an open source translation platform, to power the translation of software and documentation. All translations are hosted at Transifex.net, which provides a web application allowing translators to write, submit, and manage their translations. Document translations are then pulled into the document's git repository, where they can be built and published to http://docs.fedoraproject.org.
Documentation maintainers are responsible for the following:
- pushing changes to their guide or other document to Transifex.net
- pulling updated translations back to their git repository
- publishing the translations to http://docs.fedoraproject.org
This page explains how to set up Transifex for use with your document.
Step 1: Create an Account on Transifex.net
Go to https://www.transifex.net/ and click on Register in the top right hand corner to create an account.
Step 2: Install the Transifex Client
To use Transifex with your git repository, you need the transifex-client
package installed from the Fedora repositories.
Step 3: Configure .transifexrc
Edit the file ~/.transifexrc, adding your Transifex.net username and password in the following format:
[https://www.transifex.net] hostname = https://www.transifex.net username = <username> password = <password>
Step 4: Initialize Transifex in Your Git Repository
Go to the git repository of your document and change to the current Fedora release branch. Alternatively, you can create a new branch specifically for translations by branching the release branch, and then periodically merge updated content from the release branch to the branch with translations. After choosing the approach that is appropriate for you and changing to the branch, enter the following commands, replacing <url>
with the url of your document's project page on Transifex.net:
tx init
tx set --autoremote <url>
This will create a .tx
folder in your repository.
Step 5: Map Language Codes
If you have translation folders already in your repository, you may need to map the language codes to the ones used by Transifex.net, if they are different.
To do this, open the file .tx/config
. You should see a [main]
section which allows you to set configurations for the whole document, followed by sections for the individual files of which your document is comprised (resources, in Transifex terminology). In the [main]
section, edit the lang_map
line to map the language codes in your repository to the ones used on Transifex.net. For example, if your repository uses ro-RO
for Romanian and bg-BG
for Bulgarian, but Transifex.net uses ro
and bg
respectively, the lang_map
line should look like this:
lang_map = ro:ro-RO,bg:bg-BG
The language code used in Transifex.net comes first, followed by the language code used by the folder in your repository. Multiple language mappings are given as a comma-separated list.
Step 6: Edit File Filters
By default, transifex-client
downloads translations and stores them in a translations
folder in your repository. For Fedora documentation, transifex-client
must be configured to download the translations to the root folder of your repository, with each language having its own folder, so that Publican can find them.
For each resource listed in the .tx/config
file, edit the file_filter
line to give the correct location:
file_filter = <lang>/<resource>.po
Replace <resource> with the name of the resource, which is the second part of the section title shown directly above. For example:
[fedora-release-notes.Amateur_Radio] file_filter = <lang>/Amateur_Radio.po source_file = pot/Amateur_Radio.pot source_lang = en
Step 7: Pushing and Pulling Translations
Your document repository should now be configured for Transifex! Whenever a change is made to your document, use the following commands to push the changes to Transifex.net so that translators can translate them:
publican update_pot
tx push -s
If you need to edit a .po file locally, you can push the changes back to Transifex.net:
tx push -t
To pull updated translations from Transifex.net:
tx pull -a
You can use the -l
option to specify specific languages to pull, for example if you know that a particular language has new translations available.
Refer to the wiki page Publishing_a_document_with_Publican for information on how to publish translated documentation to http://docs.fedoraproject.org.
Step 8: Branching and Updating Translations Before a New Release
First, change to the branch intended for the previous Fedora release. Then create a new branch for the upcoming release and change to the branch:
git checkout -b <newbranch>
Assuming that the content development for the upcoming release happened in the master branch, which is different from the release branch, you should merge the updates from the master branch:
git merge master
After successful merging, check that the resource configuration in the .tx/config
file is still up-to-date and applies to the current documentation. Especially pay attention to changed, moved or removed chapters in your document. If you need to remove an unused resource, run the following command:
tx delete -r <documentation>.<resource>
For example, if you want to remove the resource Amateur_Radio from the Fedora Release Notes, execute the following command:
tx delete -r fedora-release-notes.Amateur_Radio
When you are done with all necessary changes, follow the usual procedure with pushing and pulling translations that is described in the previous step.