Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
hello po!
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mitcho (Michael 芳貴 Erlewine)  
View profile  
 More options Jun 15 2009, 11:23 am
From: "mitcho (Michael 芳貴 Erlewine)" <mit...@mitcho.com>
Date: Tue, 16 Jun 2009 00:23:28 +0900
Local: Mon, Jun 15 2009 11:23 am
Subject: hello po!
Hi all,

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Blair McBride  
View profile  
 More options Jun 15 2009, 9:54 pm
From: Blair McBride <unfocu...@gmail.com>
Date: Tue, 16 Jun 2009 13:54:09 +1200
Local: Mon, Jun 15 2009 9:54 pm
Subject: Re: [ubiq i18n] hello po!
Impressive!

- Blair

On 16/06/09 3:23 AM, "mitcho (Michael 芳貴 Erlewine)" wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jono  
View profile   Translate to Translated (View Original)
 More options Jun 16 2009, 1:24 am
From: Jono <jdica...@mozilla.com>
Date: Mon, 15 Jun 2009 22:24:21 -0700
Local: Tues, Jun 16 2009 1:24 am
Subject: Re: [ubiq i18n] Re: hello po!
Great work, Mitcho!

What do I need to do to make strings _() able?  Can you point me at
some documentation or examples for that?  I am currently going through
all the standard feeds renaming commands for the Overlord Verbs
standard, so I might as well _() ify them at the same time, once I
know how.
--Jono


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mitcho (Michael 芳貴 Erlewine)  
View profile   Translate to Translated (View Original)
 More options Jun 16 2009, 1:34 am
From: "mitcho (Michael 芳貴 Erlewine)" <mit...@mitcho.com>
Date: Tue, 16 Jun 2009 14:34:23 +0900
Local: Tues, Jun 16 2009 1:34 am
Subject: Re: [ubiq i18n] Re: hello po!
All you have to do is wrap localizable strings in preview's or  
execute's with _(). Since moving to po _() doesn't support  
replacements via printf format, you can simply leave ${variables} in  
the strings and run the result through RenderTemplate, if need be.

I recommend leaving as much formatting as possible out of the  
individual strings to localize. For example, if your string is  
something like "<p>Here's a paragraph.</p><p>Here's another.</p>",  
then it would be best if you put it as "<p>"+_("Here's a paragraph")
+"</p><p>"+_('Here's another.')+"</p>". A little messy, perhaps, but  
it will make localizations much cleaner and more straightforward.

mitcho

--
mitcho (Michael 芳貴 Erlewine)
mit...@mitcho.com
http://mitcho.com/
linguist, coder, teacher

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jono  
View profile   Translate to Translated (View Original)
 More options Jun 16 2009, 12:46 pm
From: Jono <jdica...@mozilla.com>
Date: Tue, 16 Jun 2009 09:46:35 -0700
Local: Tues, Jun 16 2009 12:46 pm
Subject: Re: [ubiq i18n] Re: hello po!
Is there a particular source file that needs to be included for _() to
be in the namespace?

--Jono

2009/6/15 "mitcho (Michael 芳貴 Erlewine <mit...@mitcho.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mitcho (Michael 芳貴 Erlewine)  
View profile   Translate to Translated (View Original)
 More options Jun 16 2009, 8:14 pm
From: "mitcho (Michael 芳貴 Erlewine)" <mit...@mitcho.com>
Date: Wed, 17 Jun 2009 09:14:35 +0900
Local: Tues, Jun 16 2009 8:14 pm
Subject: Re: [ubiq i18n] Re: hello po!
Nope, there shouldn't need to be. _ should be defined in the  
namespace. Is there an instance where that's not the case?

m

--
mitcho (Michael 芳貴 Erlewine)
mit...@mitcho.com
http://mitcho.com/
linguist, coder, teacher

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »