Instructions for translators

From WeBWorK_wiki
Jump to navigation Jump to search

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 needs translating. It saves a .po file, for example tr.po (resp. es.po, etc.) which contains the translations of those strings into 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.


Converting existing .pm files

If you have already created a *.pm file (e.g. fr.pm) defining translation strings by editing %Lexicon in a perl file then you can send Mike Gage and/or Jason Aubrey the file. They can translate it into a .po file so that you will not loose any of the translating work you have done so far.

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
  • We are using the ISO_639-1 convention for languages.
  • 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. The automatic comments panel contain the line numbers in the source file of the string. Comments can be added at any time. Include any information that will be helpful to future translators.
  • The .po and .pot files are simply text files. You can view these files in any text editor to see their format and to inspect any changes. It is safer to update them using Poedit since that insures that the format is preserved.

Updating an existing .po file from webwork2.pot

  • Obtain new webwork2.pot file, with new strings to translate, from the SVN or from programmers.
  • Open your current .po file in Poedit
  • Choose "Catalog --> Update from POT file..." from menu
  • Select new webwork2.pot file
  • Any new untranslated strings in webwork2.pot will be added to your .po file
  • Translate the new strings
  • Save and return the new .po file for testing.

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.

Testing translations locally

  • If you have administrative access to a WeBWorK server, you may test the resulting .po file locally as follows:
    • Save the .po file to /opt/webwork/webwork2/lib/WeBWorK/Localize
    • Restart the apache2 server (sudo systemctl restart apache2 on Ubuntu)
    • Select the language from the course configuration of a course on the server.

Tips on translations

Translation_tips (please add your comments)

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