<?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>G-ROC web applications &#187; i18n</title>
	<atom:link href="http://www.g-roc.com/category/i18n/feed" rel="self" type="application/rss+xml" />
	<link>http://www.g-roc.com</link>
	<description>PHP freelancer, web developer, mobile web enthusiast</description>
	<lastBuildDate>Sun, 22 Nov 2009 18:34:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Poedit xgettext parser setup reminder</title>
		<link>http://www.g-roc.com/33_poedit-xgettext-parser-setup-reminder.html</link>
		<comments>http://www.g-roc.com/33_poedit-xgettext-parser-setup-reminder.html#comments</comments>
		<pubDate>Fri, 30 May 2008 00:09:13 +0000</pubDate>
		<dc:creator>Rocco</dc:creator>
				<category><![CDATA[i18n]]></category>

		<guid isPermaLink="false">http://www.g-roc.com/33_poedit-xgettext-parser-setup-reminder.html</guid>
		<description><![CDATA[This is more or less a reminder to myself. Since there do not seem to be many sources about this exact issue and I had to search for it a couple of times already I thought it might be nice to have it up on my own blog. Working on many international project I&#8217;ve been [...]]]></description>
			<content:encoded><![CDATA[<p>This is more or less a reminder to myself. Since there do not seem to be many sources about this exact issue and I had to search for it a couple of times already I thought it might be nice to have it up on my own blog.</p>
<p>Working on many international project I&#8217;ve been using <a href="http://www.poedit.net/">Poedit</a> for a while now. <a href="http://www.poedit.net/">Poedit</a> is an editor for gettext catalogs (.po files). To gether with PHP and the gettext extension it&#8217;s a great tool to implement multilingual web applications.</p>
<p>The issue is that you can set up a parsers in Poedit, basically definitions of file types and command line parameters for <a href="http://www.scit.wlv.ac.uk/cgi-bin/mansec?1+xgettext">xgettext</a>, which is executed fo find the parts in a file that should be translated. So there is a parser for PHP in there, but often, for example in the <a href="http://www.cakephp.org/">CakePHP</a> framework, you have to deal with files that are PHP files, but that have a different extension, in the CakePHP case views end with .thtml &#8230; Just adding &#8220;*.thtml&#8221; to the list of extensions in the PHP parser setup does not cut the mustard and you end up getting an error message like this:</p>
<p><strong><em>xgettext: warning: file &#8216;[...].thtml&#8217; extension &#8216;thtml&#8217; is unknown; will try C</em>.</strong></p>
<p>To solve this, you need to tell xgettext that it has to deal with PHP files by adding &#8220;&#8211;language=PHP&#8221; to the list of commandline options. This is done by opening Poedit&#8217;s preferences and navigating to the parsers section there. In the PHP parser under &#8220;Parser command&#8221; (btw. this is the MAC version of Poedit) I have now the following line:</p>
<p><code>xgettext --language=PHP --force-po -o %o %C %K %F</code></p>
<p>Voila, .thtml files or any file specified in the PHP parser is now treated as PHP and my translation sections are found.</p>
<p>Thanks to <a href="http://thread.gmane.org/gmane.editors.poedit.user/633">Vaclav for his answer here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.g-roc.com/33_poedit-xgettext-parser-setup-reminder.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
