<?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>WordPress Rocks! &#187; .po</title>
	<atom:link href="http://wprocks.com/tags/po/feed/" rel="self" type="application/rss+xml" />
	<link>http://wprocks.com</link>
	<description>Commentary by Sadish on WordPress and his Themes</description>
	<lastBuildDate>Wed, 28 Dec 2011 04:02:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>What it takes to internationalize a theme?</title>
		<link>http://wprocks.com/wordpress-tips/what-it-takes-to-internationalize-a-theme/</link>
		<comments>http://wprocks.com/wordpress-tips/what-it-takes-to-internationalize-a-theme/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 14:32:24 +0000</pubDate>
		<dc:creator>Sadish</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[.mo]]></category>
		<category><![CDATA[.po]]></category>
		<category><![CDATA[.pot]]></category>
		<category><![CDATA[theme internationalization]]></category>

		<guid isPermaLink="false">http://wprocks.com/?p=305</guid>
		<description><![CDATA[Quite often, I do get emails from people who wants a version of my theme, ported to their language. I always thought it is a cumbersome job to make the theme internationalized.
but recently my opinion got changed by a Danish guy.]]></description>
			<content:encoded><![CDATA[<p>Quite often, I do get emails from people who wants a version of my theme, ported to their language. I always thought it is a cumbersome job to make the theme internationalized.<br />
but recently my opinion got changed by a Danish guy.</p>
<p>Henrik from http://henrik.schack.dk/ recently contacted me asking me if it is OK to release <a href="http://henrik.schack.dk/2008/03/22/mistylook-wordpress-tema-pa-dansk/" title="Danish version of MistyLook" target="_blank">the Danish version of MistyLook</a> that he worked on.</p>
<p>I had a little chat with him over the email and this is what I learned.<br />
<span id="more-305"></span><br />
<strong>Step 1: Prepare your WordPress Theme:</strong><br />
You have to wrap all your text within the theme, inside a<br />
<code><br />
&lt;?php _e('some text goes here', 'ml') ?&gt;<br />
</code><br />
It means if you want the sidebar&#8217;s heading to have<br />
<code><br />
&lt;h3&gt;Pages&lt;/h3&gt;<br />
</code><br />
you should actually be coding it as<br />
<code><br />
&lt;h3&gt;&lt;?php _e('Pages','ml'); ?&gt;&lt;/h3&gt;.<br />
</code><br />
You should do this everywhere the theme emits any text. </p>
<p>Next thing we have to do is, add a line in the functions.php.<br />
<code><br />
&lt;?php load_theme_textdomain('ml'); ?&gt;<br />
</code><br />
where &#8216;ml&#8217; is the short form of the theme name &#8216;MistyLook&#8217;.</p>
<p><strong>Step 2: Create a .POT file</strong><br />
The next step is to create a .POT file. This file is the catalog of all the places in the theme files, that we want the text to be translated.<br />
something like<br />
<code><br />
#: archive.php:36 search.php:19<br />
msgid "Read Full Post &amp;#187;"<br />
msgstr ""<br />
</code><br />
which specifies the line number 36 in the archive.php file and the line number 19 in the search.php has the text &#8220;Read Full Post &amp;#187;&#8221; which needs to be translated.<br />
Similarly it has entries for each of the text items that has to be translated.</p>
<p><strong>Step 3 : Translating the theme</strong><br />
This .POT file we created in the previous step, is the starting point for our translation effort.<br />
Now somebody has to say if it is &#8220;Permanent Link&#8221; in english, it is called &#8220;Lien Permanent&#8221; in french or &#8220;EslabÃ³n Permanente&#8221; in Spanish [I just used an online translator for arriving at this text].<br />
So if somebody wants to translate the theme to Spanish, they will simply load the .POT file that we have for the theme into a software like <a href="http://www.poedit.net/" title="PO Edit" target="_blank">PO Edit</a> and enter the equivalent Spanish strings for each of the English string we have provided.<br />
From this tool, we can generate a .MO file for Spanish translation or a .MO file for French etc.<br />
Once a .MO file is created, it should be placed within the theme folder.</p>
<p><strong>How does WordPress know to apply this .MO file?</strong><br />
Ok. We have a .MO file which contains the translated text for German, for example.<br />
but for the WordPress to load this file, you need to change the wp-config.php file.<br />
Look for<br />
<code><br />
define ('WPLANG', '');<br />
</code><br />
and change it to<br />
<code><br />
define ('WPLANG', 'de');<br />
</code></p>
<p>This is for when you have a German Translated file. If your language is different, you should use your language code instead of &#8216;de&#8217;.</p>
<p>Thats it.<br />
If a language file is found, then it will be used or otherwise it will use the text in English.</p>
<p>[This article is a draft of what I have understood so far, about making the theme ready for translation. As I learn more, I will update this post.<br />
First Posted on : April 01 2008.<br />
]</p>
]]></content:encoded>
			<wfw:commentRss>http://wprocks.com/wordpress-tips/what-it-takes-to-internationalize-a-theme/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

