Difference between revisions of "Instructions for translators"

From WeBWorK_wiki
Jump to navigation Jump to search
Line 19: Line 19:
 
===Creating a new .po file from webwork2.pot ===
 
===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. )
 
* 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:
+
* Fill out Catalog-->Settings: [[Image:Poedit_settings.png|thumb|widthpx|POedit Settings]].
[[Image:Poedit_settings.png|thumb|widthpx| ]].
 
 
If you don't fill out this "settings" box you will get a warning error message when you save. However nothing else will happen.
 
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 [mailto:gage@math.rochester.edu Mike Gage] and/or [mailto:aubreyja@missouri.edu Jason Aubrey ]
 
* Save the file as fr.po (French) or es.po (Spanish). If unsure what name to give the language file email [mailto:gage@math.rochester.edu Mike Gage] and/or [mailto:aubreyja@missouri.edu Jason Aubrey ]
 
* Proceed to add translations in the lower panel of the window
 
* Proceed to add translations in the lower panel of the window
[[Image:Poedit_window.png|thumb|widthpx| ]]
+
[[Image:Poedit_window.png|thumb|widthpx|Pedit Window ]]
 
* Save often :-)
 
* 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.
 
* 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.

Revision as of 17:52, 10 December 2011

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.


Background

  • Definitions
    • .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.).
  • 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:
    POedit 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
Pedit 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

Uploading translations

  • When you have translated phrases you would like to have tested:
    • save your translations using Poedit
    • email the .po and .mo files which it creates as attachments to Mike Gage and/or to Jason Aubrey .
    • Include a brief description of what you have done.
    • They will upload the file to a WeBWorK course where you can test your translations.

Thank you

If you have questions email Mike Gage or Jason Aubrey .

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.

Technical resources