Author: runa Date: 2011-03-02 19:30:13 +0000 (Wed, 02 Mar 2011) New Revision: 24290
Modified: translation/trunk/documentation/howto.txt Log: some more text for the translation howto
Modified: translation/trunk/documentation/howto.txt =================================================================== --- translation/trunk/documentation/howto.txt 2011-03-02 17:16:57 UTC (rev 24289) +++ translation/trunk/documentation/howto.txt 2011-03-02 19:30:13 UTC (rev 24290) @@ -288,7 +288,7 @@ Start by checking out the following directory: https://svn.torproject.org/svn/projects/android/trunk/Orbot/.
- You can use the following script to convert translated .po files to .xml files:: + 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. @@ -369,14 +369,17 @@ directory and run 'tx pull'. Remember to commit the changes to SVN.
- 2. Converting Translations to + 2. Updating the Translations on the Server Hosting Torcheck
- # TODO: document how to convert translations to a useful format. + 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
# TODO: document this as well - + (xgettext cgi-bin/TorCheck.py -dTorCheck -oi18n/TorCheck.pot) + 4. Adding New Translation Resources to Transifex
To add new translation resources to Transifex, open up @@ -389,156 +392,59 @@ server, cd to the 'po' directory and run 'tx push' with either '-s' or '-t'.
----------------------------- TorCheck ------------------------------- +The Website:
-TorCheck uses our translation portal to accept translations. Users use -the portal to check in their changes. To make use of the translations -that users have committed to the translations/ subversion module, you'll -need to ensure that you have a current checked out copy of TorCheck: + The Transifex configuration file, source file and translations can + be found here: + https://svn.torproject.org/svn/translation/trunk/projects/website/. + + You will also need to check out the wml files for the website: + https://svn.torproject.org/svn/website/trunk/.
- cd check/trunk/i18n/ - check/trunk/i18n$ svn up + 1. Pulling Translations from the Transifex Server
-You should see something like the following: + 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.
- Fetching external item into 'pootle' - External at revision 15300. + 2. Converting Translations to WML
- At revision 15300. + 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.
-Now if you had changes, you'd simply want to move the newly updated .po files -into the current stable directory. Moving the .po files from -'check/trunk/i18n/pootle/' into 'check/trunk/i18n' properly naming the files -for their respective locale. + 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.
-Here's an example of how to move all of the current pootle translations into -the svn trunk area of TorCheck: + 3. Creating/Updating Translation Template Files
- cd check/trunk/i18n/ - for locale in `ls -1 pootle/|grep -v template`; - do - mv -v pootle/$locale/TorCheck_$locale.po TorCheck_$locale.po; - done + 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.
-Now check the differences (ensure the output looks reasonable): + 4. Adding New Translation Resources to Transifex
- svn diff + 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.
-Ensure that msgfmt has no errors: + 5. Pushing Files to the Transifex Server
- msgfmt -C *.po + 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'.
-And finally check in the changes: +Tor Manual Pages:
- svn commit + The Transifex configuration file, source file and translations can + be found here: + https://svn.torproject.org/svn/translation/trunk/projects/manpages/
----------------------------- Torbutton ------------------------------- + 1. Pulling Translations from the Transifex Server
-Torbutton uses our translation portal to accept translations. Users use -the portal to check in their changes. - -To make use of the translations that users have committed to the translations/ -subversion module, you'll need to ensure that you have a current checked out -copy of them in your torbutton git checkout: - - cd torbutton.git/trans_tools - torbutton.git/trans_tools$ svn co https://tor-svn.freehaven.net/svn/translation/trunk/projects/torbutton pootle - -You should see something like the following: - - Checked out revision 21092. - -If you made changes to strings in Torbutton, you need to rebuild the -templates in torbutton.git/trans_tools/pootle/templates. This is done with -the following command from within the torbutton.git checkout directory: - - moz2po -P -i src/chrome/locale/en/ -o trans_tools/pootle/templates/ - -You now have two options: - -Option 1 (The [shitty] Pootle Web UI Way): - -View then commit the changes to the template with: - - cd trans_tools/pootle - svn diff templates - svn commit templates - -Then poke Jake to 'svn up' on the Pootle side. If you do this enough -times, he may give you a button to click to update templates in Pootle, -or maybe even an account on the Pootle server. Persistence is a virtue. - -You then need to go to the Pootle website and click the checkbox next to -every language on: -https://translation.torproject.org/projects/torbutton/admin.html -and then click "Update Languages" at the bottom. - -You then need to go to each language and go to "Editing Options" and click -"Commit" for each one. - -You then need to 'svn up' locally, and follow the procedure above for -rebuilding your .dtd and .properties files. - -Yes, this sucks. :/ - -Option 2 (Use your own msgmerge: YMMV, may change .po flags and formatting): - -Run msgmerge yourself for each language: - - cd trans_tools - for i in `ls -1 pootle` - do - msgmerge -U ./pootle/$i/torbutton.dtd.po ./pootle/templates/torbutton.dtd.pot - msgmerge -U ./pootle/$i/torbutton.properties.po ./pootle/templates/torbutton.properties.pot - done - svn diff pootle - svn commit pootle - -Then poke Jake to 'svn up' on the Pootle side. If you do this enough times, -he may give you a button on Pootle, or maybe even an account on the Pootle -server. Persistence is a virtue. - -You may notice that some .po file flags and string formatting have changed -with this method, depending on your gettext version. It is unclear if this -is a problem. Please update this doc if you hit a landmine and everything -breaks :) - -After this process is done, you then need to regenerate the mozilla -.dtd and .properties files as specified above. - - -Regardless of whether or not you had changes in the torbutton strings, if there -were updated strings in pootle that you checked out from svn you now need to -convert from .po and move the newly updated mozilla files into the current -stable locale directory. First convert them with the 'mkmoz.sh' script and -then move the proper mozilla files from 'torbutton.git/trans_tools/moz/' into -'torbutton.git/src/chrome/locale/' directory while properly naming the files -for their respective locale. - -Here's an example of how to move all of the current pootle translations into -the svn trunk area of Torbutton: - - cd trans_tools - ./mkmoz.sh - for locale in `ls -1 moz/`; - do - mv -v moz/$locale/*.{dtd,properties} ../src/chrome/locale/$locale/ - done - -Now check the differences to your git branch to ensure the output looks -reasonable: - - cd .. - git diff - -And finally check in the changes: - - cd src/chrome/locale - git commit . - ----------------------------- Vidalia ------------------------------- - -Vidalia uses our translation portal to accept translations. Users use the -portal to check in their changes. No conversion or moving is required other -than normal pootle usage. -