<?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"
	>

<channel>
	<title>Eat my monkeydust &#187; i18n</title>
	<atom:link href="http://eatmymonkeydust.com/category/i18n/feed" rel="self" type="application/rss+xml" />
	<link>http://eatmymonkeydust.com</link>
	<description>Life, PHP and Symfony - straight from the monkey's mouth</description>
	<pubDate>Mon, 04 Aug 2008 08:57:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Yaml (yml) file gotchas - trying to set default culture to &#8220;no&#8221;</title>
		<link>http://eatmymonkeydust.com/2008/05/yaml-yml-file-gotchas-trying-to-set-default-culture-to-no/</link>
		<comments>http://eatmymonkeydust.com/2008/05/yaml-yml-file-gotchas-trying-to-set-default-culture-to-no/#comments</comments>
		<pubDate>Fri, 09 May 2008 17:03:49 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Symfony]]></category>

		<category><![CDATA[configuration]]></category>

		<category><![CDATA[i18n]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=24</guid>
		<description><![CDATA[The yaml file parser will attempt to parse all the values, rather than taking them as they are - which in most cases is a good thing, however you must remember to use quotes when the intended output is a string, and the parser may interpret the value otherwise:

default_culture:   en
// No problem, en [...]]]></description>
			<content:encoded><![CDATA[<p>The yaml file parser will attempt to parse all the values, rather than taking them as they are - which in most cases is a good thing, however you must remember to use quotes when the intended output is a string, and the parser may interpret the value otherwise:</p>

<div class="wp_syntax"><div class="code"><pre class="php">default_culture<span style="color: #66cc66;">:</span>   en
<span style="color: #808080; font-style: italic;">// No problem, en is treated as a string </span>
<span style="color: #808080; font-style: italic;">// and /en/ is automatically added to links</span>
&nbsp;
default_culture<span style="color: #66cc66;">:</span> no
<span style="color: #808080; font-style: italic;">// Oops, no is translated by Symfony </span>
<span style="color: #808080; font-style: italic;">// the same way as false, 0 or off, giving it a boolean value!</span>
&nbsp;
default_culture<span style="color: #66cc66;">:</span> <span style="color: #ff0000;">'no'</span>
<span style="color: #808080; font-style: italic;">// That's better, now you will have the intended results.</span></pre></div></div>

<p>The same applies to any yml files that you may have &#8220;keywords&#8221; in, so try to always use quotes round everything that is not boolean, integer, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2008/05/yaml-yml-file-gotchas-trying-to-set-default-culture-to-no/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I18n is for life (actions), not just for Christmas (templates)</title>
		<link>http://eatmymonkeydust.com/2008/04/i18n-is-for-life-actions-not-just-for-christmas-templates/</link>
		<comments>http://eatmymonkeydust.com/2008/04/i18n-is-for-life-actions-not-just-for-christmas-templates/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 16:38:46 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
		
		<category><![CDATA[Symfony]]></category>

		<category><![CDATA[i18n]]></category>

		<category><![CDATA[action]]></category>

		<category><![CDATA[internationalisation]]></category>

		<category><![CDATA[internationalization]]></category>

		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=8</guid>
		<description><![CDATA[Well, the point is make sure you Internationalise everything, not just the text you have in the templates.
For example, when using ajax calls you may be rendering text directly from actions, or you may be throwing exceptions which have meaningful error messages which are displayed by the template. You need to remember to &#8220;i18nalise&#8221; this [...]]]></description>
			<content:encoded><![CDATA[<p>Well, the point is make sure you Internationalise everything, not just the text you have in the templates.</p>
<p>For example, when using ajax calls you may be rendering text directly from actions, or you may be throwing exceptions which have meaningful error messages which are displayed by the template. You need to remember to &#8220;i18nalise&#8221; this text too&#8230;</p>
<p>From an action, you can access the i18n function via the context singleton, as documented by the Symfony docs (http://www.symfony-project.org/book/1_0/13-I18n-and-L10n)</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #ff0000">$this</span><span style="color: #66cc66;">-&gt;</span><span style="color: #006600;">getContext</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-&gt;</span><span style="color: #006600;">getI18n</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-&gt;</span>__<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;yourtexthere&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Remember to do it now, and you won&#8217;t kick yourself later!</p>
]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2008/04/i18n-is-for-life-actions-not-just-for-christmas-templates/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
