Author: runa Date: 2011-03-03 14:26:06 +0000 (Thu, 03 Mar 2011) New Revision: 24297
Modified: translation/trunk/documentation/howto.txt Log: wrote more text and reorganized a couple of things
Modified: translation/trunk/documentation/howto.txt =================================================================== --- translation/trunk/documentation/howto.txt 2011-03-03 13:39:36 UTC (rev 24296) +++ translation/trunk/documentation/howto.txt 2011-03-03 14:26:06 UTC (rev 24297) @@ -151,7 +151,45 @@ and will not overwrite newer files. Use --help for more information.
+All projects:
+ The method for pushing/adding/pulling source files and + translations to/from the Transifex server is the same for all + translation projects. + + 1. Pulling Translations from the Transifex Server + + To pull new translations from the server, cd to the 'po' + directory and run 'tx pull'. Remember to commit the changes to + SVN. + + 2. Adding New Translation Resources to Transifex + + To add new translation resources to Transifex, open up + 'po/.tx/config' and create entries for the new resources. Use an + existing entry as a template. Remember to commit the file to SVN. + + 3. Pushing Files to the Transifex Server + + To push new/updated source files or translations to the Transifex + server, cd to the 'po' directory and run 'tx push' with either + '-s' or '-t'. + + The rest of this howto will talk about the different translation + projects; where you can find the Transifex configuration file, + source files, translations, how you convert the translations to a + useful format and how you create and/or update a translation + template file. + +Necessary packages: + + You will want to install the following packages (available in both + Debian and Ubuntu, and probably other distributions as well): + + 1. po4a: http://po4a.alioth.debian.org/ + 2. gettext: http://www.gnu.org/software/gettext/ + 3. translation-toolkit: http://translate.sourceforge.net/wiki/toolkit/index/ + BridgeDB:
# TODO: document the translation workflow for BridgeDB when we have @@ -168,14 +206,8 @@ be found here: https://svn.torproject.org/vidalia/vidalia/trunk/src/vidalia/help/content/.
- 1. Pulling Translations from the Transifex Server + 1. Converting Translations to HTML
- To pull new translations from the server, cd to the 'po' - directory and run 'tx pull'. Remember to commit the changes to - SVN. - - 2. Converting Translations to HTML - Simply pulling translations from the Transifex server is not enough. To make use of the translations, you will need to convert the .po files to .html files. @@ -183,10 +215,8 @@ You can use the following script to automate the process: https://svn.torproject.org/vidalia/vidalia/trunk/src/vidalia/help/content/po...
- NOTE: You need to have the package 'po4a' installed before running the script. + 2. Creating/Updating Translation Template Files
- 3. Creating/Updating Translation Template Files - To create a .pot file from an .html file, run the following command:
$ po4a-gettextize -f html -m file.html -p file.pot @@ -196,93 +226,43 @@ in 'po/templates' as a template. Remember to commit the file to SVN.
- 4. Adding New Translation Resources to Transifex - - To add new translation resources to Transifex, open up - 'po/.tx/config' and create entries for the new resources. Use an - existing entry as a template. Remember to commit the file to SVN. - - 5. Pushing Files to the Transifex Server - - To push new/updated source files or translations to the Transifex - server, cd to the 'po' directory and run 'tx push' with either - '-s' or '-t'. - Vidalia Installer:
The Transifex configuration file, source file and translations can be found here: https://svn.torproject.org/vidalia/vidalia/trunk/pkg/win32/po/.
- 1. Pulling Translations from the Transifex Server + 1. Converting Translations
- To pull new translations from the server, run 'tx pull'. Remember - to commit the changes to SVN. + # TODO: document how to convert translations to a useful format.
- 2. Converting Translations + 2. Creating/Updating Translation Template Files
- # TODO: document how to convert translations to a useful format. + # TODO: document how to convert from a useful format to .pot
- 3. Creating/Updating Translation Template Files - - # TODO: document how to convert from a useful format to .pot - - 4. Adding New Translation Resources to Transifex - - To add new translation resources to Transifex, open up - '.tx/config' and create entries for the new resources. Use an - existing entry as a template. Remember to commit the file to SVN. - - 5. Pushing Files to the Transifex Server - - To push new/updated source files or translations to the Transifex - server, simply run 'tx push' with either '-s' or '-t'. - Vidalia:
The Transifex configuration file, source file and translations can be found here: https://svn.torproject.org/vidalia/vidalia/trunk/src/vidalia/i18n/po/.
- 1. Pulling Translations from the Transifex Server + 1. Converting Translations
- To pull new translations from the server, run 'tx pull'. Remember - to commit the changes to SVN. - - 2. Converting Translations - # TODO: document how to convert translations to a useful format.
- 3. Creating/Updating Translation Template Files + 2. Creating/Updating Translation Template Files
# TODO: document how to convert from a useful format to .pot
- 4. Adding New Translation Resources to Transifex - - To add new translation resources to Transifex, open up - '.tx/config' and create entries for the new resources. Use an - existing entry as a template. Remember to commit the file to SVN. - - 5. Pushing Files to the Transifex Server - - To push new/updated source files or translations to the - Transifex server, simply run 'tx push' with either '-s' or '-t'. - Orbot:
The Transifex configuration file, source file and translations can be found here: https://svn.torproject.org/svn/translation/trunk/projects/orbot/po/.
- 1. Pulling Translations from the Transifex Server + 1. Converting Translations to XML
- To pull new translations from the server, run 'tx pull'. Remember - to commit the changes to SVN. - - 2. Converting Translations to XML - - Simply pulling translations from the Transifex server is not - enough. To make use of the translations, you will need to convert + To make use of the translations, you will need to convert the .po files to .xml files.
Start by checking out the following directory: @@ -291,10 +271,8 @@ You can use the following script to convert translated .po files to .xml files: https://svn.torproject.org/vidalia/vidalia/trunk/src/vidalia/help/content/po...
- NOTE: You need to have the package 'po4a' installed before running the script. + 2. Creating/Updating Translation Template Files
- 3. Creating/Updating Translation Template Files - To create a .pot file from an .xml file, run the following command:
@@ -305,17 +283,6 @@ in 'orbot/po/templates' as a template. Remember to commit the file to SVN.
- 4. Adding New Translation Resources to Transifex - - To add new translation resources to Transifex, open up - '.tx/config' and create entries for the new resources. Use an - existing entry as a template. Remember to commit the file to SVN. - - 5. Pushing Files to the Transifex Server - - To push new/updated source files or translations to the - Transifex server, simply run 'tx push' with either '-s' or '-t'. - Torbutton and Torbutton-alpha:
The Transifex configuration file, source file and translations can @@ -326,17 +293,11 @@
You will also need: https://gitweb.torproject.org/torbutton.git/.
- 1. Pulling Translations from the Transifex Server + 1. Converting Translations to Mozilla Files
- To pull new translations from the server, cd to the 'po' - directory and run 'tx pull'. Remember to commit the changes to - SVN. - - 2. Converting Translations to Mozilla Files - # TODO: document how to convert translations to mozilla files.
- 3. Creating/Updating Translation Template Files + 2. Creating/Updating Translation Template Files
If you made changes to strings in Torbutton, you need to rebuild the templates in the 'po/templates' directory. This is done with @@ -345,53 +306,32 @@
$ moz2po -P -i src/chrome/locale/en/ -o /path/to/po/templates
- 4. Adding New Translation Resources to Transifex - - To add new translation resources to Transifex, open up - 'po/.tx/config' and create entries for the new resources. Use an - existing entry as a template. Remember to commit the file to SVN. - - 5. Pushing Files to the Transifex Server - - To push new/updated source files or translations to the Transifex - server, cd to the 'po' directory and run 'tx push' with either - '-s' or '-t'. - Torcheck:
The Transifex configuration file, source file and translations can be found here: https://svn.torproject.org/svn/translation/trunk/projects/torcheck/.
- 1. Pulling Translations from the Transifex Server + You will also need the TorCheck subversion repository: + https://svn.torproject.org/svn/check/trunk/.
- To pull new translations from the server, cd to the 'po' - directory and run 'tx pull'. Remember to commit the changes to - SVN. + 1. Updating the Translations on the Server Hosting Torcheck
- 2. Updating the Translations on the Server Hosting Torcheck - After pulling new translations from Transifex, someone will have to put the .po files on the server where Torcheck is running so that TorCheck.py can find them.
- 3. Creating/Updating Translation Template Files + 2. Creating/Updating Translation Template Files
- # TODO: document this as well - (xgettext cgi-bin/TorCheck.py -dTorCheck -oi18n/TorCheck.pot) - - 4. Adding New Translation Resources to Transifex + To update the translation template file for TorCheck, run the + following command inside the TorCheck directory:
- To add new translation resources to Transifex, open up - 'po/.tx/config' and create entries for the new resources. Use an - existing entry as a template. Remember to commit the file to SVN. + $ xgettext cgi-bin/TorCheck.py -dTorCheck -oi18n/TorCheck.pot
- 5. Pushing Files to the Transifex Server + You will then have to copy TorCheck.pot to + translation/projects/torcheck/po/templates and commit the + changes.
- To push new/updated source files or translations to the Transifex - server, cd to the 'po' directory and run 'tx push' with either - '-s' or '-t'. - The Website:
The Transifex configuration file, source file and translations can @@ -401,50 +341,61 @@ You will also need to check out the wml files for the website: https://svn.torproject.org/svn/website/trunk/.
- 1. Pulling Translations from the Transifex Server + 1. Converting Translations to WML
- To pull new translations from the server, cd to the 'po' - directory in the translation module and run 'tx pull'. Remember - to commit the changes to SVN. + To make use of the translations, you will need to convert the .po + files to .wml files.
- 2. Converting Translations to WML - - Simply pulling translations from the Transifex server is not - enough. To make use of the translations, you will need to convert - the .po files to .wml files. - You can use the 'po2wml.sh' script inside the website module to convert translated .po files to .wml. Make sure that you check out the two subversion modules in the same directory, so that you have (for example) ~/tor/website and ~/tor/translation.
- NOTE: You need to have the package 'po4a' installed before running the script. + 2. Creating/Updating Translation Template Files
- 3. Creating/Updating Translation Template Files - To create a .pot file from a new .wml file, or to update existing .pot files when one or more website files are updated, run the - 'wml2po.sh' script. Make sure that you check out the two - subversion modules in the same directory, so that you have (for - example) ~/tor/website and ~/tor/translation. + 'wml2po.sh' script. This script will update the headers of the + .pot files as well.
- 4. Adding New Translation Resources to Transifex + Make sure that you check out the two subversion modules in the + same directory, for example ~/tor/website and ~/tor/translation.
- To add new translation resources to Transifex, open up - 'po/.tx/config' and create entries for the new resources. Use an - existing entry as a template. Remember to commit the file to SVN. - - 5. Pushing Files to the Transifex Server - - To push new/updated source files or translations to the Transifex - server, cd to the 'po' directory and run 'tx push' with either - '-s' or '-t'. - Tor Manual Pages:
The Transifex configuration file, source file and translations can be found here: https://svn.torproject.org/svn/translation/trunk/projects/manpages/
- 1. Pulling Translations from the Transifex Server + You will also need to check out the Tor git repository: + git://git.torproject.org/tor/.
+ And the website: https://svn.torproject.org/svn/website/trunk/. + + 1. Converting Translations to Text + + To make use of the translations, you will need to convert the .po + files to .txt files. + + You can use the 'po2man.sh' script inside the manpages directory + (located in the website subversion module) to convert translated + .po files to .txt. This script will also create the files + necessary to include translations of tor-manual-dev.html.en when + the website is built. + + Make sure that you clone and check out the git and subversion + repositories in the same directory, for example ~/tor/tor, + ~/tor/website and ~/tor/translation. + + 2. Creating/Updating Translation Template Files + + To create a .pot file from a new .txt file, or to update existing + .pot files when one or more of the man pages are updated, run the + following command (for each file you want to convert): + + $ po4a-gettextize -f text -m file.txt -p file.pot + + You will need to edit the header of the .pot file once it has + been created. Use the header from one of the existing .pot files + in 'orbot/po/templates' as a template. Remember to commit the + file to SVN.