I just wanted to let the i18n group know that I today implemented
localization with po (gettext portable object) files. Based on a
number of comments I received in the past week, including a few from
our very knowledgeable l10n team at Mozilla, I decided to at least
give the po a stab. It turns out that using the jsgettext library (http://developer.berlios.de/projects/jsgettext/
) I could get it working in less than a day. This change will open
Ubiquity command localization up to the vast resources and tools of
the po world.
One particular advantage of po is that it is a truly bilingual format,
so the source text can be right there as a reference. There are no
particular format restrictions on the keys (message ID's, or msgid),
as opposed to properties files. There also is a message context
(msgctxt) property which helps keep the msgid's less cluttered. Here's
an example entry from firefox.ja.po which I was using to test:
msgctxt "zoom.preview"
msgid "Zooms the Firefox window to ${replacement} of its normal size."
msgstr "ウインドウを通常の${replacement}のサイズで表
示。"
So here's the string "Zooms the Firefox window to ${replacement} of
its normal size." in the context of the preview() of the zoom command,
and its Japanese equivalent. Properties (like names) don't take
contexts and look like this:
msgid "zoom.names"
msgstr "ズーム|ズームして|ズームする|ズームしろ"
I also updated the localization template tool to produce po-formatted
templates (often called .pot). You can go to the command list and
click on a feed's "get localization template" link to get the
template. The localization template tool's recognition of _()'d
strings in preview and execute are imperfect, but they will hopefully
pick up a good number of the strings required in localization. If it's
missing some, of course, you can add your own entries to the po file.
Moreover, many strings in commands have yet to be _()'d... we'd
appreciate anyone who wants to pitch in and make some more commands
localizable as well.
Thanks for all the comments and feedback!
mitcho
--
mitcho (Michael 芳貴 Erlewine)
mit...@mitcho.com
http://mitcho.com/
linguist, coder, teacher