Instructions for translators
Editing Instructions for WeBWorK translators
- Getting started as a translator:
- You should download the java based application Poedit. (See http://www.poedit.net/). The download page is http://www.poedit.net/download.php
- Obtain the webwork2.pot file from http://webwork.maa.org/viewvc/system/trunk/webwork2/lib/WeBWorK/Localize/.
- Click on webwork2.pot
- Click on "download" near the top of the page
- If the page opens in the browser window save it as webwork2.pot in the directory where you will work on translations.
- At the same location you might also find the current versions of the .po file for each language. Download them in the same way.
- The .po and .pot files are simply text files. You can view their format in any text editor. It is safer to update them using Poedit since that insures that the format is preserved.
- .po stands for portable object. It is a text file which consists of strings to be translated followed by their translations. It also contains comment lines which give the location of the string in the source file. Translators modify this file to add new translations to strings.
- .pot stands for portable object template. Developers modify (or recreate) this file when the original code file is rewritten. The format for this file is the same as for the .po file, but the translations are ignored. This file exists to specify which strings need to be translated.
- Poedit uses the webwork2.pot file as a template or catalog to define the strings that need translating. It saves a .po file, for example tr.po (resp. es.po, etc.) which contains the translations of those strings in Turkish (resp. Spanish, etc.). When one merges an existing .po file and an existing .pot file all of the string entries of the .pot file are used and the corresponding translations in .po file are used if they exist.
Creating a new .po file from webwork2.pot
- Open the webwork2.pot file. (You may need to change the pop-up menu to "all files" so that the .pot files are displayed. )
- Fill out Catalog-->Settings:
If you don't fill out this "settings" box you will get a warning error message when you save. However nothing else will happen.
- Save the file as fr.po (French) or es.po (Spanish). If unsure what name to give the language file email Mike Gage and/or Jason Aubrey
- Proceed to add translations in the lower panel of the window
- Save often :-)
- You can display or hide the comment panels and other panels using the "view" menu. Automatic comments are the line numbers in the source file. Comments can be anything.
- The .po and .pot files are simply text files. You can view these files in any text editor to see what is happening. It is safer to update them using Poedit since that insures that the format is preserved.
Updating an existing .po file from webwork2.pot
- Open the .po file in Poedit
- Choose Catalog --> Update from POT file... from menu
- Select new webwork2.pot file
- Any new untranslated strings will be added to your .po file
- Translate the new strings
- Save and return the new .po file for testing.
- When you have translated phrases you would like to have tested:
Please help modify this wiki page to make the instructions more accurate and complete.
Thank you for your help in making WeBWorK available in every language.
- Instructions on creating .pot and .po files http://betterwp.net/wordpress-tips/create-pot-file-using-poedit/
- PO file format: http://www.gnu.org/s/hello/manual/gettext/PO-Files.html