<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mitcho.com &#187; commands</title>
	<atom:link href="http://mitcho.com/blog/tag/commands/feed/" rel="self" type="application/rss+xml" />
	<link>http://mitcho.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 02:04:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>A Visual Guide to Community Command Localization</title>
		<link>http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/</link>
		<comments>http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 22:11:30 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Matt Mullenweg]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2475</guid>
		<description><![CDATA[A natural language interface is only &#8220;natural&#8221; if it&#8217;s in your natural language. With this mantra in mind, we&#8217;ve been making steady progress on the challenging problem of Ubiquity localization. The first fruit of this research is in the localization of the parser and bundled commands in Ubiquity 0.5. Here today is a visual guide [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-update/' rel='bookmark' title='Ubiquity Localization Update'>Ubiquity Localization Update</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural language interface</a> is only &#8220;natural&#8221; if it&#8217;s in your natural language. With this mantra in mind, we&#8217;ve been making steady progress on the challenging problem of <a href="http://ubiquity.mozilla.com">Ubiquity</a> localization. The first fruit of this research is in the localization of the parser and bundled commands <a href="http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/">in Ubiquity 0.5</a>. Here today is a visual guide on command localization in Ubiquity and different options we can take in attacking the community command localization problem.<span id="more-2475"></span></p>

<h3>Command localization in Ubiquity 0.5</h3>

<p>A few important design decisions have already been made in implementing command localization in Ubiquity 0.5. The first was the choice of the <a href="http://en.wikipedia.org/wiki/gettext">gettext</a> po (portable object) file format. The po format is a de facto industry standard with many tools built for the format and this design choice hopefully lower the bar for prospective localizers.</p>

<p>Second, in order to simplify the matching of localizations and commands, we require that each command feed have one localization po file, rather than splitting the localizations of different commands across multiple po files.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/dist.png" alt="dist.png" border="0" width="650" height="250" /></p>

<p>Finding the appropriate localization po file for a JavaScript command feed is very simple with bundled commands as the files are managed in our main repository so we know exactly where to find them. We just take the command feed&#8217;s filename sans extension—the <em>feed key</em>—and look for <code>localizations/</code><em>lang</em><code>/</code><em>feed key</em><code>.po</code>, where <em>lang</em> is the active language code. This gives us a simple one to one relationship between the JavaScript command feed source and the appropriate localization.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/local.png" alt="local.png" border="0" width="650" height="218" /></p>

<h3>Background</h3>

<p>The ability of users to <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Author_Tutorial">easily write their own Ubiquity commands</a> has always been a huge strength of the Ubiquity platform. Users can also &#8220;subscribe&#8221; to commands written by other users on other servers. In this case, local copies of those command sources are made.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/distcmds.png" alt="distcmds.png" border="0" width="650" height="420" /></p>

<p>The <a href="http://ubiquity.mozilla.com/herd/">herd</a> was developed as a dynamic aggregator of community Ubiquity commands. The herd keeps its own copy of each command source. The herd groups mirrors of command feeds on multiple servers together as well, giving each unique command feed a unique ID.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/herd.png" alt="herd.png" border="0" width="650" height="240" /></p>

<h3>Localizing distributed resources</h3>

<p>This distributed nature of the command feeds is exactly what complicates the localization of community commands. The original sources themselves are distributed, and we also want a community of localizers to be able to localize the commands—i.e., for the localizations to be (in some sense) distributed. Here I will present three options which I believe could be the basis for a winning solution, in order of more distributed to less distributed.</p>

<p>All three of these options have the property that localizations do not need to be &#8220;approved&#8221; or &#8220;managed&#8221; by the command author. For example, a possible standard where URL&#8217;s of localizations must be in the command feed is not considered. I believe this is a crucial property of any approach we decide on.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<h4>Option 1: a completely distributed option</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/option1.png" alt="herd.png" border="0" width="650" height="300" /></p>

<p>In this option, localizers simply put the po files on their own servers (or some code snippet site such as github) and the user must then subscribe to those localizations much as they subscribe to commands now.</p>

<h4>Option 2: registration and discovery through the herd</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/option2.png" alt="herd.png" border="0" width="650" height="400" /></p>

<p>In this option, localizers put po files up on their own servers and then register that po file&#8217;s URL with the herd. The herd keeps track of each command feed&#8217;s localizations in different languages.</p>

<h4>Option 3: localizations on the herd</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/option3.png" alt="herd.png" border="0" width="650" height="340" /></p>

<p>In this option, po localizations are uploaded right onto the herd. The herd is the centralized repository of all localizations for each command feed.</p>

<h3>Users first</h3>

<p>In coming up with a criteria for judging different models of community command localization, I think it is helpful to think of the end-user experience. Right now to subscribe to a new command a user must find the command (perhaps via the herd) and click on the subscribe button, then in most cases confirm that they are aware of the possible dangers and confirm subscription.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> What work is required for a user to subscribe to a new command <em>and get it in their language</em>?</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/subscribe.png" alt="herd.png" border="0" width="650" height="40" /></p>

<p>Under option one, the user would somehow have to find the localization scattered someplace on the internet of their own accord, and then install that localization by themself. In my mind, this is clearly a no go. With options two or three, however, when a user subscribes to a command feed Ubiquity can check with the herd to see whether there are any localizations available. The localizations could be offered to the user or the localization for the currently active language could be automatically installed. There are, on the other hand, disadvantages to requiring a centralized authority, exemplified by the fact that the current iteration of the herd itself has often been down.</p>

<h3>Summary and a call for comments</h3>

<p>As laid out in this visual guide, I personally have a couple main criteria which I believe we should follow:</p>

<ol>
<li><strong>localization independence</strong>: Command authors should not have to manage their commands&#8217; localizations. (See footnote 1.)</li>
<li><strong>friendly discovery and subscription</strong>: Users should not have to go out and find localizations by themselves. Localizations should be offered to the user.</li>
</ol>

<p>With these criteria, I&#8217;m pretty sure the only logical conclusion is that we need some level of centralization, pointing to options two and three. <strong>If you think of another option which satisfies these criteria, or disagree with the criteria above, I would love to know.</strong> In addition, <strong>have you encountered similar problems of localizing distributed resources elsewhere? What worked there?</strong></p>

<p>If this problem has been solved before, there is no need to reinvent the wheel. As far as I can tell, however, this could be a particularly hairy problem.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>This strong view is based on my own experience as a <a href="http://mitcho.com/code/yarpp/">WordPress plugin author</a> and a subsequent conversation with <a href="http://en.wikipedia.org/wiki/Matt Mullenweg">Matt Mullenweg</a>. The WordPress plugin ecosystem requires that plugin authors orchestrate localizations and bundle them into releases. In the case of my plugin, this requires regular contact with over a dozen localizers.<br/>The case of WordPress plugins is actually much like that of Ubiquity commands&#8230; the plugins can be served on any server, distributed, but there is also a central repository, <a href="http://wordpress.org/extend/">wordpress.org/extend</a>.<br/>Matt and I agreed that if localizers could somehow localize plugins without going through the command author, most of whom produce their plugins by volunteering their time, the localization of plugins could be much more popular. Indeed, some localizers go ahead and publish po files for popular plugins, but those localizations are hard to find as there is no repository for the localizations either.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>As I&#8217;ve <a href="http://mitcho.com/blog/projects/friendlier-command-feed-subscription/">written before about Ubiquity&#8217;s command subscription</a>, there is much we can improve in this area of Ubiquity&#8217;s user experience.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-update/' rel='bookmark' title='Ubiquity Localization Update'>Ubiquity Localization Update</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Localizing Commands for Ubiquity 0.5</title>
		<link>http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/</link>
		<comments>http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 11:12:23 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[participate]]></category>
		<category><![CDATA[po]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2331</guid>
		<description><![CDATA[As many of you know, earlier this week we released a preview of version 0.5 (0.5pre). We&#8217;re going to stress test and refine this release through the weekend and push the official 0.5 out next Tuesday. This release will have fully localized commands for Danish and Japanese, as well as parser settings for a number [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/localizing-ubiquity-commands-and-nountypes/' rel='bookmark' title='Localizing Ubiquity: commands and nountypes'>Localizing Ubiquity: commands and nountypes</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-update/' rel='bookmark' title='Ubiquity Localization Update'>Ubiquity Localization Update</a></li>
<li><a href='http://mitcho.com/blog/projects/big-issues-and-small-issues-with-parser-2/' rel='bookmark' title='Big Issues and Small Issues with Parser 2'>Big Issues and Small Issues with Parser 2</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>As many of you know, earlier this week we released a preview of version 0.5 (0.5pre). We&#8217;re going to stress test and refine this release through the weekend and push the official 0.5 out next Tuesday. This release will have fully localized commands for Danish and Japanese, as well as parser settings for a number of other languages. Read <a href="https://labs.mozilla.com/2009/06/ubiquity-0-5-preview-release/">this Labs blog post</a> to learn more about the 0.5 release and how to test it.</p>

<p>It&#8217;s not too late to add localizations for other languages to 0.5, though. Localizations help make Ubiquity more &#8220;natural&#8221; for more users, offering a new level of ease and familiarity to the already powerful Ubiquity. We have <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Command_Localization_Tutorial">a new tutorial to help you localize commands</a>.</p>

<p>To help encourage command localization, we now have <a href="http://en.wikipedia.org/wiki/gettext">gettext</a>-style <code>po</code> template files for all the bundled command feeds in the hg repository. You can find these files in the <code>ubiquity/localization/templates</code> directory of the repository, or <a href="http://ubiquity.mozilla.com/hg/ubiquity-firefox/file/tip/ubiquity/localization/templates">on our online hg repository</a>.</p>

<p>If you complete some localizations (even incomplete) for your language and would like to submit them into the repository, for the time being, you can post them on <a href="http://ubiquity.mozilla.com/trac/ticket/712">this trac ticket</a>.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>I&#8217;ll be looking forward to seeing your localizations! If you have any questions, feel free to ask on the <a href="http://groups.google.com/group/ubiquity-i18n/">ubiquity-i18n Google group</a> or on <a href="irc://irc.mozilla.org#ubiquity">irc.mozilla.org#ubiquity</a>. ^^</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>In the post-0.5 future we&#8217;ll be rethinking how best to organize these localization files and give commit access to as many localizers as possible.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/localizing-ubiquity-commands-and-nountypes/' rel='bookmark' title='Localizing Ubiquity: commands and nountypes'>Localizing Ubiquity: commands and nountypes</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-update/' rel='bookmark' title='Ubiquity Localization Update'>Ubiquity Localization Update</a></li>
<li><a href='http://mitcho.com/blog/projects/big-issues-and-small-issues-with-parser-2/' rel='bookmark' title='Big Issues and Small Issues with Parser 2'>Big Issues and Small Issues with Parser 2</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubiquity Localization Update</title>
		<link>http://mitcho.com/blog/projects/ubiquity-localization-update/</link>
		<comments>http://mitcho.com/blog/projects/ubiquity-localization-update/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 10:35:23 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[gettext]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2219</guid>
		<description><![CDATA[As we move closer and closer to shipping a Ubiquity with there is still much work to be done, particularly in the area of localization. In a recent Ubiquity meeting we laid out the explicit localization goals and non-goals of as follows: Goals for 0.5 Parser 2 (on by default) underlying support for localization of [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/big-issues-and-small-issues-with-parser-2/' rel='bookmark' title='Big Issues and Small Issues with Parser 2'>Big Issues and Small Issues with Parser 2</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-ubiquity-commands-and-nountypes/' rel='bookmark' title='Localizing Ubiquity: commands and nountypes'>Localizing Ubiquity: commands and nountypes</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-commands-by-the-numbers/' rel='bookmark' title='Ubiquity Commands by The Numbers'>Ubiquity Commands by The Numbers</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>As we move closer and closer to shipping a Ubiquity with <a href="https://labs.mozilla.com/2009/05/ubiquity-05-call-for-participation/">there is still much work to be done</a>, particularly in the area of localization. <a href="https://wiki.mozilla.org/Labs/Ubiquity/Meetings/2009-05-27_Weekly_Meeting">In a recent Ubiquity meeting</a> we laid out the explicit localization goals and non-goals of as follows:</p>

<ul>
<li>Goals for 0.5

<ul>
<li>Parser 2 (on by default)</li>
<li>underlying support for localization of commands</li>
<li>localization of standard feed commands for a few languages</li>
<li>Parser 2 language files for those same languages</li>
</ul></li>
<li>Nongoals for 0.5

<ul>
<li>distribution/sharing of localizations</li>
<li>localization of nountypes </li>
</ul></li>
</ul>

<p>The overall goal for this release of Ubiquity is to come up with a format and standard for localization. Localizations in Ubiquity 0.5 will only apply to commands bundled with Ubiquity, and the localization files themselves will be distributed with Ubiquity. In a future release we will tackle the problem of localizations for <a href="https://ubiquity.mozilla.com/herd/">commands in the wild</a> and truly croud-source<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> this process.</p>

<p><span id="more-2219"></span></p>

<h3>Localization Architecture</h3>

<p>The localization of Ubiquity commands will use a <a href="http://en.wikipedia.org/wiki/gettext">gettext</a>-style approach where localization files list key-value pairs for different properties and messages of the commands. For Ubiquity 0.5, where we only deal with the standard command feeds bundled Ubiquity, we can simply place all the localization files in <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/file/tip/ubiquity/standard-feeds/localization"><code>ubiquity/standard-feeds/localization</code></a>. Localization files are organized by source feed, with one localization file per source feed, per language.</p>

<p>The localizable components of commands will include the <code>names</code>, <code>contributors</code>, and <code>help</code> properties, as well as any localizable strings in the command&#8217;s <code>preview()</code> and <code>execute()</code> methods. To make strings localizable in <code>preview()</code> and <code>execute()</code>, they must be wrapped in the localize function, <code>_()</code>.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>

<p>Other localizable components, like <code>names</code>, <code>contributors</code>, and <code>help</code> will not need to be wrapped in the <code>_()</code> function. In addition, as the localization files can only hold values of strings, for values such as names and contributors, the delimiter <code>|</code> can be used to delimit multiple values.</p>

<p><pre code='javascript'>zoom.names=ズーム|ズームして|ズームする|ズームしろ</pre></p>

<h3>The Localization Experience</h3>

<p><a href="https://ubiquity.mozilla.com/trac/ticket/739">One tool we have planned</a> to help kickstart the localization process is a tool that will automatically create a template of strings that need localization in a user&#8217;s commands. I took a first stab at this tool today. Clicking on the &#8220;get localization template&#8221; link next to each feed in the <a href="chrome://ubiquity/content/cmdlist.html">Ubiquity command list</a> will give you a template which you can then copy into a text file:</p>

<p><a class='limages' href='http://mitcho.com/blog/wp-content/uploads/2009/06/localization-template.png' rel='lightbox'><img src="http://mitcho.com/blog/wp-content/uploads/2009/06/localization-template-smaller.png" alt="localization-template-smaller.png" border="0" width="600" height="437" /></a></p>

<p>Additionally, instructions will later be added to this page to specify how and where to save localizations to test them or perhaps we can add a button that will automatically save it in the right location.</p>

<h3>Open Questions</h3>

<h4>Localization file formats</h4>

<p>There are two kinds of file formats for localizations we are considering: <a href="https://developer.mozilla.org/En/XUL_Tutorial/Property_Files"><code>.properties</code></a> and <code>.po</code>, the native <a href="http://en.wikipedia.org/wiki/gettext">gettext</a> format. As an example, here is the same key-value pair in the two formats:</p>

<h5><code>.properties</code>:</h5>

<p><pre># This is a comment
welcomeMessage=Hello, world!</pre></p>

<h5><code>.po</code>:</h5>

<p><pre>#. This is a comment (the . is actually optional)
msgid "welcomeMessage"
msgstr "Hello, world!"</pre></p>

<p>The advantage of <code>.properties</code> over <code>.po</code> is that Mozilla natively supports this format with an XUL/XPCOM interface called <a href="https://developer.mozilla.org/En/XUL/Stringbundle">stringbundle</a> and it is what is used to localize JavaScript in Firefox itself. We actually already have the <code>_()</code> localization function working with the properties file format, following <a href="http://www.xuldev.org/blog/?p=45">gomita&#8217;s great instructions</a> (Japanese) on how to load properties files in using Mozilla&#8217;s native <a href="https://developer.mozilla.org/En/XUL/Stringbundle">stringbundle</a> tools via JavaScript.</p>

<p>The advantage of <code>.po</code> over <code>.properties</code> is that it is the de-facto standard in localization, particularly in the UNIX world. Lots of great tools have been written for it. The adoption of <code>.po</code> could make Ubiquity localization more accessible for more people. Another advantage is that <code>.po</code> files can have keys with spaces, as I note below.</p>

<p>If we do opt to work with <code>.po</code> files, the two libraries I see out in the wild for dealing with <code>.po</code> files are <a href="http://code.google.com/p/gettext-js/">gettext-js</a> (MIT) and <a href="http://jsgettext.berlios.de/">jsgettext</a> (LGPL). While I haven&#8217;t looked at the libraries in depth yet, so far jsgettext seems to be the winner, as some sections of gettext-js require the use of the <a href="http://www.prototypejs.org/">prototype.js</a> library.</p>

<h4>A &#8220;key&#8221; question</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/06/icanhaskeyplz.jpg" alt="icanhaskeyplz.jpg" border="0" width="650" height="416" /></p>

<p>In either file format, we need a unique way to refer to each localizable string—a key format. As each localization file refers to a command feed, the first collision we must avoid is the command name. With this in mind, we can come up with some trivial keys for the localizable properties: (here, consider the command <code>hello</code>)</p>

<ul>
<li><code>hello.names</code></li>
<li><code>hello.contributors</code></li>
<li><code>hello.help</code></li>
</ul>

<p>However, we run into difficulty when we try to come up with keys for the arbitrary text in <code>preview</code>s and <code>execute</code>s. For example, for a message like &#8220;Hello world!&#8221; in the preview, we could simply make the key <code>hello.preview.Hello world!</code> but this may be unruly and be prone to typos. In addition, in <code>.properties</code> files keys cannot have certain characters in them, like spaces, so we would have to make the key something like <code>hello.preview.Hello_world!</code> or, stripping symbols and standardizing case, <code>hello.preview.HELLO_WORLD</code>.</p>

<p>Keys could also get very long with this type of key format, although here again <code>.po</code> files may have an advantage as they can stay relatively more legible even with long keys. One option to deal with this would be to optionally supply a key argument to <code>_()</code> so that it is used instead of the automatic key. For example, suppose the <code>hello</code> command&#8217;s <code>preview()</code> included this code:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">_<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'This is a really long greeting message. Hello there!'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'longmessage'</span><span style="color: #009900;">&#41;</span></pre></div></div>


<p>then a localizer would only have to refer to <code>hello.preview.longmessage</code>, not <code>hello.preview.THIS_IS_A_REALLY_LONG_GREETING_MESSAGE_HELLO_THERE</code>.</p>

<p><a href="http://twitter.com/m_satyr">satyr</a> points out that some commands use another function to incorporate similar actions and messages in both <code>preview()</code> and <code>execute()</code>. In this case, he argues, it wouldn&#8217;t make sense to have to keep both localizations (<code>hello.preview.</code>&#8230; and <code>hello.execute.</code>&#8230;). He suggests that optional keys (mentioned above) could be used without the <code>preview.</code> or <code>execute.</code> infixes, as in <code>hello.longmessage</code>. By taking out the <code>preview</code> and <code>execute</code> namespacing in the localization keys, though, it becomes the command author&#8217;s responsibility to not accidentally use strings named &#8220;names&#8221;, &#8220;help&#8221;, etc. that will have unintended consequences.</p>

<h3>Conclusion</h3>

<p>I hope that this blog post gives people an idea of the progress we&#8217;ve made in the localization area and gets people thinking about the challenges we still face. <strong>We&#8217;d love to get your feedback on the localization format and process in Ubiquity, as well as the open problems of the file format and keys.</strong></p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Or &#8220;cloud-source&#8221;&#8230; finally a Japanese accent joke that&#8217;s semantically stable!&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>This function currently also has the ability to do simple <a href="http://en.wikipedia.org/wiki/printf">printf</a>-formatted string replacements:<br/>
<pre code='javascript'>_('This is a %S.',['test'])</pre>
<br/>Whether this format will replace support for <code>CmdUtils.renderTemplate</code> remains to be seen and is definitely worthy of discussion. If we move away from <a href="https://developer.mozilla.org/En/XUL_Tutorial/Property_Files">properties files</a>, in particular, we may keep <code>renderTemplate()</code> in lieu of the <a href="http://en.wikipedia.org/wiki/printf">printf</a> format. Mozilla&#8217;s built-in <a href="https://developer.mozilla.org/En/XUL/Stringbundle">stringbundle handling</a> just gave us a fast and free implementation of <a href="http://en.wikipedia.org/wiki/printf">printf</a>-style replacement.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/big-issues-and-small-issues-with-parser-2/' rel='bookmark' title='Big Issues and Small Issues with Parser 2'>Big Issues and Small Issues with Parser 2</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-ubiquity-commands-and-nountypes/' rel='bookmark' title='Localizing Ubiquity: commands and nountypes'>Localizing Ubiquity: commands and nountypes</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-commands-by-the-numbers/' rel='bookmark' title='Ubiquity Commands by The Numbers'>Ubiquity Commands by The Numbers</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/ubiquity-localization-update/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Where&#8217;s The Verb?</title>
		<link>http://mitcho.com/blog/observation/wheres-the-verb/</link>
		<comments>http://mitcho.com/blog/observation/wheres-the-verb/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 07:10:20 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[observation]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[infinitive]]></category>
		<category><![CDATA[linguistics]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[subjunctive]]></category>
		<category><![CDATA[typology]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[verb-final]]></category>
		<category><![CDATA[verbs]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1647</guid>
		<description><![CDATA[Ubiquity&#8217;s proposed new parser design is based on a principles and parameters philosophy: we can build an underlying universal parser and, for each individual language, we simply set some &#8220;parameters&#8221; to tell the parser how to act. As we consider the design&#8217;s pros and cons, it&#8217;s important to reflect back on the linguistic data and [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/ubiquity-i18n-questions-to-ask/' rel='bookmark' title='Ubiquity i18n: questions to ask'>Ubiquity i18n: questions to ask</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
<li><a href='http://mitcho.com/blog/projects/contribute-how-your-language-identifies-its-arguments/' rel='bookmark' title='Contribute: how your language identifies its arguments'>Contribute: how your language identifies its arguments</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Ubiquity&#8217;s <a href="https://wiki.mozilla.org/User:Mitcho/ParserTNG">proposed new parser design</a> is based on a <a href="http://en.wikipedia.org/wiki/principles and parameters">principles and parameters</a> philosophy: we can build an underlying universal parser and, for each individual language, we simply set some &#8220;parameters&#8221; to tell the parser how to act. As we consider the design&#8217;s pros and cons, it&#8217;s important to reflect back on the linguistic data and see if this architecture can adequately handle the range of linguistic data attested in our languages.</p>

<p>Today I&#8217;ll examine highlight some disparate typological data to help us understand these questions: <strong>where&#8217;s the verb?</strong> and <strong>what does the verb look like?</strong>
<span id="more-1647"></span>
There are broadly three different verb forms taken in commands in different languages:<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<ol>
<li>the <a href="http://en.wikipedia.org/wiki/infinitive">infinitive</a>,</li>
<li><a href="http://en.wikipedia.org/wiki/subjunctive mood">subjunctive mood</a>, or</li>
<li>a special verb form such as <a href="http://en.wikipedia.org/wiki/imperative">imperative</a>, <a href="http://en.wikipedia.org/wiki/participial">participial</a>, or conjunctive (such as Japanese <a href="http://en.wikipedia.org/wiki/Japanese verb conjugations#Te_form">て form</a>)</li>
</ol>

<p>Let&#8217;s give an example of each:</p>

<p><strong>Infinitive</strong> (English):<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="english" style="font-family:monospace;">Hit me!</pre></td></tr></table></div>


<p><strong>Subjunctive mood</strong> (Modern Greek): &#8220;Eat it all!&#8221;</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
3
</pre></td><td class="code"><pre class="english" style="font-family:monospace;">Na   to fas olo!
SUBJ it eat all</pre></td></tr></table></div>


<p><strong>Imperative form</strong> (French): &#8220;Eat it!&#8221;</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
5
</pre></td><td class="code"><pre class="french" style="font-family:monospace;">Mange   -le!
eat.IMP it</pre></td></tr></table></div>


<p>It&#8217;s important to note that some languages have <em>multiple forms available</em> for the same command. For example:</p>

<p><strong>Dutch</strong>: three ways to say &#8220;watch out!&#8221; with the same verb</p>

<ol>
<li>Infinitive: <code>Oppassen!</code></li>
<li>Imperative: <code>Pas op!</code></li>
<li>Participial: <code>Opgepast!</code></li>
</ol>

<p>Similarly, I received <a href="http://mitcho.com/blog/projects/ubiquity-i18n-questions-to-ask/#comment-974">a great comment by PhiliKON</a> on German and <a href="http://mitcho.com/blog/projects/ubiquity-i18n-questions-to-ask/#comment-980">associated data by Robert Kaiser</a> on my blog post yesterday:</p>

<p><strong>German</strong>: &#8220;search hello with google&#8221;</p>

<ol>
<li>Infinitive: <code>hello mit google suchen</code></li>
<li>Imperative: <code>suche hello mit google</code></li>
</ol>

<p>In addition, German and Dutch are interesting as they are <a href="http://en.wikipedia.org/wiki/V2 word order">verb second (V2)</a> languages, so the verb may surface at the beginning or the end of the sentence, depending on the form.</p>

<p>The <a href="https://wiki.mozilla.org/User:Mitcho/ParserTNG">new parser design</a> (which <a href="http://mitcho.com/code/ubiquity/parser-demo/">you can demo</a>) assumes for simplicity that the verb should be found at the beginning or the end of the input, which is consistent with the data I&#8217;ve seen (modulo <a href="http://en.wikipedia.org/wiki/Clitic#Clitics_in_Romance_languages">clitics</a>). Multiple verb forms could be accounted for by supporting &#8220;synonyms&#8221; of the verbs.</p>

<p><strong>What are the different ways verbs are expressed in commands in your language? Is the verb always found at the beginning or the end of the sentence? Is it ever somewhere in the middle?</strong></p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Some of the data and theoretical support for this section comes from, among other sources, Sabine Iatridou&#8217;s <a href="http://web.mit.edu/linguistics/people/faculty/iatridou/de_modo_imperativo.pdf">De Modo Imperativo</a> lecture notes.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Many refer to this in English as an &#8220;imperative form,&#8221; but in Modern English this is arguably the same as the infinitive.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/ubiquity-i18n-questions-to-ask/' rel='bookmark' title='Ubiquity i18n: questions to ask'>Ubiquity i18n: questions to ask</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
<li><a href='http://mitcho.com/blog/projects/contribute-how-your-language-identifies-its-arguments/' rel='bookmark' title='Contribute: how your language identifies its arguments'>Contribute: how your language identifies its arguments</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/observation/wheres-the-verb/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Ubiquity i18n: questions to ask</title>
		<link>http://mitcho.com/blog/projects/ubiquity-i18n-questions-to-ask/</link>
		<comments>http://mitcho.com/blog/projects/ubiquity-i18n-questions-to-ask/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 10:13:37 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[collaboration]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[contribute]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[linguistics]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[survey]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1611</guid>
		<description><![CDATA[I recently have traveled a fair deal and have met many people excited about the Ubiquity project and its localization efforts. &#8220;I want to help,&#8221; say the people, but many are unsure where to start. As a linguist, studying a language involves looking at instances of that language as data. To this end, we as [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/contribute-how-your-language-identifies-its-arguments/' rel='bookmark' title='Contribute: how your language identifies its arguments'>Contribute: how your language identifies its arguments</a></li>
<li><a href='http://mitcho.com/blog/projects/writing-commands-with-semantic-roles/' rel='bookmark' title='Writing commands with semantic roles'>Writing commands with semantic roles</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-in-firefox-japanese/' rel='bookmark' title='Ubiquity in Firefox: Focus on Japanese'>Ubiquity in Firefox: Focus on Japanese</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently have traveled a fair deal and have met many people excited about <a href="http://ubiquity.mozilla.com">the Ubiquity project</a> and <a href="https://wiki.mozilla.org/Labs/Ubiquity/i18n">its localization efforts</a>. &#8220;I want to help,&#8221; say the people, but many are unsure where to start.</p>

<p>As a linguist, studying a language involves looking at instances of that language as data. To this end, we as Ubiquity internationalizers need to get at some examples of <em>target utterances</em>. Here&#8217;s an example survey which could be a good starting point for native speakers who want to contribute information on their language, based on <a href="https://wiki.mozilla.org/Taskfox/Verbs">Blair&#8217;s list of common Ubiquity verbs</a>.</p>

<p><span id="more-1611"></span></p>

<hr style='border-top: 2px gray dashed; height: 0; color: white;'/>

<h2>A survey for Ubiquity localization</h2>

<h3>Instructions</h3>

<p>How would you express the following commands in your language? The words in CAPITAL LETTERS do not need to be translated. Feel free to give multiple possible answers for each command.</p>

<p>Try to express the same command rather than forcing a &#8220;literal translation&#8221;; for example, if there&#8217;s no &#8220;map&#8221; verb in your language, you could translate example (8) as <code>lookup a map of PLACE</code>. Please keep in mind that the <a href="http://en.wikipedia.org/wiki/addressee">addressee</a> is a computer.</p>

<h3>Basic word order / argument structure</h3>

<ol>
<li><code>search HELLO</code></li>
<li><code>search HELLO with google</code></li>
<li><code>translate HELLO from English to French</code></li>
<li><code>lookup the weather for PLACE</code></li>
<li><code>shop for SHOES with Amazon</code></li>
<li><code>email HELLO to Bill</code></li>
<li><code>email HELLO to ADDRESS</code></li>
<li><code>map PLACE</code></li>
<li><code>find HELLO</code></li>
<li><code>tab to HELLO</code> or <code>switch to HELLO tab</code></li>
</ol>

<p>&#8230;</p>

<h3>Pronominal/deictic arguments (aka &#8220;magic words&#8221;)</h3>

<ol>
<li><code>search this with google</code></li>
<li><code>translate this to French</code></li>
<li><code>bookmark this tab</code></li>
</ol>

<p>&#8230;</p>

<hr style='border-top: 2px gray dashed; height: 0; color: white;'/>

<h3>How this data is used</h3>

<p>Responses to these surveys would be used to identify certain salient features of the language, such as <a href="http://mitcho.com/blog/projects/three-ways-to-argue-over-arguments/">how the language codes for its arguments</a> (for example using <a href="http://en.wikipedia.org/wiki/adpositions">adpositions</a>, <a href="http://en.wikipedia.org/wiki/case marking">case marking</a>, or word order), whether the commands tend to be verb-inital or -final. Individual case markings, for example, can be identified by comparing <em><a href="http://en.wikipedia.org/wiki/minimal pairs">minimal pairs</a></em>—for example, by comparing item (1) and (2), we can learn how <code>google</code> in an instrumental role is marked, or by comparing example (2) and the &#8220;magic word&#8221; example (1), we can identify the appropriate &#8220;magic word&#8221; and determine whether the language uses any <a href="http://en.wikipedia.org/wiki/clitics">clitics</a> or not.</p>

<h3>Data collection</h3>

<p>In the future we ideally could build a web-based system to collect these &#8220;utterances.&#8221; We could also use such a system to automatically test our parsers in different languages against the sentences in the <em>command-bank,</em> or ultimately even generate parser parameters based on those sentences. That would essentially reduce the parser-construction process to a more run-of-the-mill string translation process.</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/contribute-how-your-language-identifies-its-arguments/' rel='bookmark' title='Contribute: how your language identifies its arguments'>Contribute: how your language identifies its arguments</a></li>
<li><a href='http://mitcho.com/blog/projects/writing-commands-with-semantic-roles/' rel='bookmark' title='Writing commands with semantic roles'>Writing commands with semantic roles</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-in-firefox-japanese/' rel='bookmark' title='Ubiquity in Firefox: Focus on Japanese'>Ubiquity in Firefox: Focus on Japanese</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/ubiquity-i18n-questions-to-ask/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

