<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://labs.echoditto.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>EchoDitto Labs - Drupal Internationalization: Part I, and introduction - Comments</title>
 <link>http://labs.echoditto.com/drupal-i18n-L10n-part-1</link>
 <description>Comments for &quot;Drupal Internationalization: Part I, and introduction&quot;</description>
 <language>en</language>
<item>
 <title>Same here, I found out the</title>
 <link>http://labs.echoditto.com/drupal-i18n-L10n-part-1#comment-4066</link>
 <description>&lt;p&gt;Same here, I found out the hard way about that problem you mentioned... still don&#039;t know what&#039;s a good way to fix it!  Waiting eagerly for your next installment!&lt;/p&gt;
</description>
 <pubDate>Wed, 10 Sep 2008 09:45:12 -0700</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 4066 at http://labs.echoditto.com</guid>
</item>
<item>
 <title>I am currently working on</title>
 <link>http://labs.echoditto.com/drupal-i18n-L10n-part-1#comment-4063</link>
 <description>&lt;p&gt;I am currently working on multi language site, waiting for next instalments. Keep it up.&lt;/p&gt;
</description>
 <pubDate>Sat, 06 Sep 2008 19:16:02 -0700</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 4063 at http://labs.echoditto.com</guid>
</item>
<item>
 <title>Drupal Internationalization: Part I, and introduction</title>
 <link>http://labs.echoditto.com/drupal-i18n-L10n-part-1</link>
 <description>&lt;p&gt;We&#039;ve recently begun putting together the infrastructure for a number of upcoming projects which will organize people around the world toward some pretty powerful, ambitious goals.  While the details of those sites are still in the works, working with Drupal to create multi-language sites has been a great experience involving a great deal of learning. This is the first of a two part series covering how Drupal works with multiple languages and the best practices/tricks of the trade for making the most of the Drupal Local, i18n and L10n systems.&lt;/p&gt;
&lt;h3 id=&quot;whattheh3listhisi18nl10nc2pallaboutanyway&quot;&gt;What the h3l is this i18n/L10n c2p all about, anyway?&lt;/h3&gt;
&lt;p&gt;Don&amp;#8217;t be scared by the geekspeak! &amp;#8220;i18n&amp;#8221; and &amp;#8220;L10n&amp;#8221; are just abbreviations for &amp;#8220;internationalization&amp;#8221; and &amp;#8220;localization&amp;#8221;, the engineering methodologies used to create software packages and websites which can be used by speakers of different languages.  i18n is the process of engineering an application so that it can be adapted for use by speakers of different languages or in different regions without needing major modifications and L10n is the related step of providing conversions between languages, date formats, etc. so the software or site can be accessed in any particular language (see the &lt;a href=&quot;http://en.wikipedia.org/wiki/Internationalization_and_localization&quot;&gt;Wikipedia article on i18n and L10n&lt;/a&gt; for more). &lt;/p&gt;
&lt;h3 id=&quot;howdrupalhandlesinternationalization&quot;&gt;How Drupal Handles Internationalization&lt;/h3&gt;
&lt;p&gt;Internationalizing an application is no trivial process, and the engineering challenges of architecting a Content Management System (CMS) capable of handling content authored in any of some set of languages and translated into any number of other languages is especially formidable: not only does the content of translated pages need to easily accessible via a unique URL, but the site&amp;#8217;s navigation must correctly reflect the content available in each language, the interface elements and HTML generated by the CMS code and any plugin modules needs to be translated (form element labels, validation errors, and such), templates must be able to adjust for right-to-left languages, just to name a few.&lt;/p&gt;
&lt;p&gt;Drupal&amp;#8217;s internationalization is provided two modules: the Locale module, part of Drupal&amp;#8217;s core distribution, allows for the &amp;#8220;interface strings&amp;#8221;, those bits of HTML output by the Drupal code, to be translated into languages other than English (English is the base language of the Drupal codebase). The Content Translate module in core along with the i18n suite of contrib modules, on the other hand, support the translation of a sites content, as well as adapting the menu and taxonomy systems for multilingual sites. Other contrib modules, such as the localization module, also provide similar features to the i18n modules but won&amp;#8217;t be covered here.&lt;/p&gt;
&lt;p&gt;The Locale module&amp;#8217;s handling of text strings produced within the Drupal codebase is fairly straightforward: any words which will be output as part a page&amp;#8217;s content are wrapped in a &lt;code&gt;t()&lt;/code&gt; function call.  The &lt;code&gt;t()&lt;/code&gt; function is not, strictly speaking, provided by the Locale module; it is defined in the all-powerful &lt;code&gt;common.inc&lt;/code&gt;.  The &lt;code&gt;t()&lt;/code&gt; function proper merely looks through the contents of of the global &lt;code&gt;$custom_strings&lt;/code&gt; variable for any matches to a given string and translates as specified in the &lt;code&gt;settings.php&lt;/code&gt; file. If the locale module is present, however, &lt;code&gt;t()&lt;/code&gt; delegates to the &lt;code&gt;local()&lt;/code&gt; function, which fetches translations of strings from the database and, depending on the module&amp;#8217;s settings, maintains a cache of used translations.  These translations of interface strings are provided in &lt;code&gt;gettext&lt;/code&gt; format &lt;code&gt;.po&lt;/code&gt; files which supply translation strings for each language for each module or, by default, through the locale modules &amp;#8220;Translate Interface&amp;#8221; admin page which allows individual interface string translations to be entered (though not as elegantly as with the &lt;a href=&quot;http://drupal.org/project/l10n_client&quot;&gt;Localization Client&lt;/a&gt; module).&lt;/p&gt;
&lt;p&gt;While this approach works well for strings within Drupal code, for &lt;a href=&quot;http://groups.drupal.org/node/1827&quot;&gt;various reasons&lt;/a&gt; it does not work nearly as well for user generated content (for starters, consider the complexity of storing and retrieving translations for a strings originally authored in any one of a site&amp;#8217;s supported language). The core requirement of an internationalization framework for a web CMS is that it support the translation of any page&amp;#8217;s content.  The &lt;a href=&quot;http://drupal.org/handbook/modules/translation&quot;&gt;Content Translate&lt;/a&gt; module allows for every post to not only have a specified language but also for translations of nodes to be stored and associated to each other in the database.  Content Translate achieves this by technically storing translations as separate nodes from the original with a &amp;#8220;translation bit&amp;#8221; set.  This approach allows for a very elegant interface for entering and maintaining translations of any content: simply click the &amp;#8220;translate&amp;#8221; tab when logged in as an administrator, choose the language you want to enter the translation for, and enter the translated title and content.  If path aliases are used, the translated content for any node can be reached by prepending the language code to the pages path (i.e. &lt;code&gt;fr/about/contact&lt;/code&gt; would give the French version of &lt;code&gt;about/contact&lt;/code&gt;)&lt;/p&gt;
&lt;p&gt;The complexity comes in when one considers the other data associated with a given node, such as taxonomy terms, CCK fields, menu items and publication/comment settings.   The Content Translate module&amp;#8217;s approach is a very simple and elegant solution to the internationalization problem, but it has the unfortunate side effect: it&amp;#8217;s possible for different translations of the same piece of content to have very different taxonomy terms, menu item hierarchies and post settings.  As an example, consider the menu hierarchy: in essence Content Translate maintains separate menu trees for each language, which means that the a translated node could live in two very different locations on the site from the original and that users visiting the site in different languages may see different menu options depending on the coverage of translations in any one language.  This can be problematic if, taking our earlier about section example, the about page has not yet been translated then the contact page on the French site may be located in the primary navigation and the there is no way for French speaking visitors to read the mission statement.   In addition, this introduces  a host of maintenance and administrator-user-error scenarios: an admin may make a navigation change that is not carried over through all translations or might mistakenly mis-parent a single translations menu item. Similar problems arise with taxonomy terms (the management of translations of folksonomy/freetagged terms, for instance) and other post settings (though these are mostly a big more straightforward).&lt;/p&gt;
&lt;p&gt;In the next installment, we&amp;#8217;ll go over some clever solutions to these issues which we&amp;#8217;ve learned through practice and from our good friends at &lt;a href=&quot;http://www.developmentseed.org/&quot;&gt;Development Seed&lt;/a&gt;&amp;#8230;&lt;/p&gt;
&lt;h3 id=&quot;furtherreading&quot;&gt;Further Reading&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://fplanque.net/Blog/devblog/2003/08/15/introducing_i18n_and_l10n&quot; title=&quot;Introducing i18n and l10n&quot;&gt;http://fplanque.net/Blog/devblog/2003/08/15/introducing_i18n_and_l10n&lt;/a&gt; - i18n and L10n basics&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.masteringdrupal.com/screencast/new-i18n-l10n-features-drupal-6&quot; title=&quot;New i18n and l10n features in Drupal 6 - half-hour long screencast | Mastering Drupal&quot;&gt;New i18n and l10n features in Drupal 6 - half-hour long screencast | Mastering Drupal&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
 <comments>http://labs.echoditto.com/drupal-i18n-L10n-part-1#comments</comments>
 <category domain="http://labs.echoditto.com/taxonomy/term/46">drupal</category>
 <category domain="http://labs.echoditto.com/taxonomy/term/199">i18n</category>
 <category domain="http://labs.echoditto.com/taxonomy/term/198">internationalization</category>
 <category domain="http://labs.echoditto.com/taxonomy/term/201">l10n</category>
 <category domain="http://labs.echoditto.com/taxonomy/term/200">localization</category>
 <pubDate>Thu, 24 Jul 2008 12:13:17 -0700</pubDate>
 <dc:creator>Ethan</dc:creator>
 <guid isPermaLink="false">81 at http://labs.echoditto.com</guid>
</item>
</channel>
</rss>
