Etoys Translations

From OLPC
Revision as of 02:31, 31 October 2008 by Cjl (talk | contribs) (cat)
Jump to navigation Jump to search

(Writing is on-going)

General Introduction

While Squeak/Etoys used custom translation engine in previous version, new translation engine based on gettext emulation has been implemented and used in OLPC version. You can provide translation data as MO file of gettext. And you can even edit it on Pootle.

On this page I will explain some basic information and tips for populate translation for your language, especially specifics to Squeak/Etoys.

structure of translation data

Migrate legacy translation dictionary

If you have been using old version of Squeak and have legacy translation dictionary in image or external file, you can migrate it and reuse as start of populating for OLPC Etoys. -prepare OLPC Etoys developer image, apply all updates -load legacy translation data -export to PO

Populate translation dictionary

Prioritize translation work

Etoys has many capability, then has huge translatable phrases (>3000). It will take much effort to complete translation work if that is done sequentially from start to end on Pootle.

But in typical usage, limited number of phrases are revealed to users. You could see on Pootle that only about 40-50% of phrases have been translated for languages with longer history of squeak usage (French, Spanish, Japanese for instances). It is more than usable for those languages.

So it is wise to prioritize work as frequently used phrases first.

Read context for phrases on PO source file

With context comment in PO file, you can see where the phrase is used in Squeak source code. On Pootle context is shown only for current record for editing. You can review it extensively if you have PO file at hand by downloading. Example 1:

 #: Sugar,SugarNavigatorBar>>buttonStop
 msgid "Stop and Quit Etoys"
 msgstr ""

First string "Sugar" is class category. Second string is formatted as class>>method.

Example 2: (very long comment is shown as splitted)

 #: Morphic-Kernel,Morph>>additionsToViewerCategoryGeometry, (cont'd)
 SimpleSliderMorph>>additionsToViewerCategories
 msgid "The width"
 msgstr ""

In this example, same phrase "The width" is used in multiple methods: -Morph>>additionsToViewerCategoryGeometry -SimpleSlider>>additionsToViewerCategories Note that these methods belong to different class categories, but only category first occurence belongs to is shown.

Phrases are sorted by category and occurrence.

Placeholder for parameter

Number enclosed by curly braces is the special symbol for placeholder where some parameter will be filled in.

 msgid ""
 "This file's version ({1}) is higher than \n"
 "the currently supported version ({2}). \n"
 "It may contain features that are not supported \n"
 "and it may not display correctly.\n"
 "Do you want to continue?"

You can change order how placeholders appear in, or you can use same placeholder multiple times if you need. But you must not remove the braces. To know what will be filled you need to review actual squeak code.

How to test translation

For base EToys, the correct directory for MO file is: /usr/share/etoys/lang/<language code>/LC_MESSAGES. Place compiled MO onto there. Start Etoys and choose your language. Then see what works and not.