Etoys Translations: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
m (typo)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
(Writing is on-going)
== General Introduction ==
== General Introduction ==


Etoys uses "gettext"-style translations. Basically, the Etoys "POT" translation template files are translated into "PO" files. These are just plain text files. They are then compiled into machine-readable "MO" files for use by Etoys.
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 [https://dev.laptop.org/translate/projects/etoys Pootle].


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


Etoys translations are hosted on the '''Pootle''' server by Sugar Labs:
== structure of translation data ==


http://translate.sugarlabs.org/projects/etoys_new/
== 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.
You can edit them right on the server. Or download a PO file and and upload it once it is translated.
-prepare OLPC Etoys developer image, apply all updates

-load legacy translation data
Everyone can submit "suggestions" on Pootle. To actually commit the suggestions for Etoys, you need to ask the "language admin". For this, please subscribe to the [http://lists.laptop.org/listinfo/localization localization mailing list].
-export to PO

== Getting Help ==

Please subscribe to the [http://lists.laptop.org/listinfo/localization localization mailing list] and send your questions there.


== Translation tips ==
== Populate translation dictionary ==
=== Prioritize translation work ===
=== 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.
[[Etoys]] is a very capable system, and consequently has a huge number of translatable phrases (more than 3000). It will take a while to complete the translation. It is wise to prioritize the work.


Here is the suggested order for translations, more important first:
But in typical usage, limited number of phrases are revealed to users. You could see on [https://dev.laptop.org/translate/projects/etoys 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.


# Sugar.po
So it is wise to prioritize work as frequently used phrases first.
# Etoys-Tiles.po
# Etoys.po
# Protocols.po
# MorphicExtras.po
# Morphic.po
# System.po
# Sound.po
# WS-Sound.po
# Connectors.po
# DrGeoII-Core.po
# ST80.po
# Files.po
# Network.po
# Kernel.po
# Graphics.po
# ... and then the rest

=== 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


=== Read context for phrases on PO source file ===
=== Read context for phrases on PO source file ===
Line 36: Line 61:
msgstr ""
msgstr ""
In this example, same phrase "The width" is used in multiple methods:
In this example, same phrase "The width" is used in multiple methods:
-Morph>>additionsToViewerCategoryGeometry
*Morph>>additionsToViewerCategoryGeometry
-SimpleSlider>>additionsToViewerCategories
*SimpleSlider>>additionsToViewerCategories
Note that these methods belong to different class categories, but only category first occurence belongs to is shown.
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.
Phrases are sorted by category and occurrence.


== Placeholder for parameter ==
=== Placeholder for parameter ===
Number enclosed by curly braces is the special symbol for placeholder where some parameter will be filled in.
Number enclosed by curly braces is the special symbol for placeholder where some parameter will be filled in.
msgid ""
msgid ""
Line 52: Line 77:
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.
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 ==
=== How to test translation ===


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

[[Category:Language support]]
[[Category:Languages (international)]]
[[category:localization]]

Latest revision as of 18:37, 28 November 2010

General Introduction

Etoys uses "gettext"-style translations. Basically, the Etoys "POT" translation template files are translated into "PO" files. These are just plain text files. They are then compiled into machine-readable "MO" files for use by Etoys.

How to translate

Etoys translations are hosted on the Pootle server by Sugar Labs:

http://translate.sugarlabs.org/projects/etoys_new/

You can edit them right on the server. Or download a PO file and and upload it once it is translated.

Everyone can submit "suggestions" on Pootle. To actually commit the suggestions for Etoys, you need to ask the "language admin". For this, please subscribe to the localization mailing list.

Getting Help

Please subscribe to the localization mailing list and send your questions there.

Translation tips

Prioritize translation work

Etoys is a very capable system, and consequently has a huge number of translatable phrases (more than 3000). It will take a while to complete the translation. It is wise to prioritize the work.

Here is the suggested order for translations, more important first:

  1. Sugar.po
  2. Etoys-Tiles.po
  3. Etoys.po
  4. Protocols.po
  5. MorphicExtras.po
  6. Morphic.po
  7. System.po
  8. Sound.po
  9. WS-Sound.po
  10. Connectors.po
  11. DrGeoII-Core.po
  12. ST80.po
  13. Files.po
  14. Network.po
  15. Kernel.po
  16. Graphics.po
  17. ... and then the rest

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

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.