<?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>reinventar &#187; Blog</title>
	<atom:link href="http://reinventar.com/tag/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://reinventar.com</link>
	<description>now with double the colour and flavor!</description>
	<lastBuildDate>Mon, 22 Feb 2010 20:10:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>BaseApp Orange updated with basic pages and i18n support</title>
		<link>http://reinventar.com/2009/03/baseapp-orange-updated-with-basic-pages-and-i18n-support/</link>
		<comments>http://reinventar.com/2009/03/baseapp-orange-updated-with-basic-pages-and-i18n-support/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 18:40:28 +0000</pubDate>
		<dc:creator>psousa</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[baseapp-orange]]></category>
		<category><![CDATA[orange]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://reinventar.com/?p=528</guid>
		<description><![CDATA[Just a quick post to illustrate the changes I did to BaseApp Orange and how you can help shape it&#8217;s way.
BaseApp Orange is my attempt to create a base for future Rails projects which end up having similar constraints and features. This week I posted the code on github and I did some changes I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Freinventar.com%2F2009%2F03%2Fbaseapp-orange-updated-with-basic-pages-and-i18n-support%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Freinventar.com%2F2009%2F03%2Fbaseapp-orange-updated-with-basic-pages-and-i18n-support%2F" height="61" width="51" /></a></div><p>Just a quick post to illustrate the changes I did to <a href="http://github.com/psousa/baseapp-orange/tree/master">BaseApp Orange </a>and how you can help shape it&#8217;s way.</p>
<p><a href="http://github.com/psousa/baseapp-orange/tree/master">BaseApp Orange</a> is my attempt to create a base for future Rails projects which end up having similar constraints and features. This week I posted the code on github and I did some changes I thought I should comunicate.</p>
<p><strong>Added SEO fields for Pages</strong></p>
<p>I consider this one important. Basicaly, for each Page you create in the admin area, you can write the meta-keywords, meta-description and page slug for that page. When this page shows up in the frontend, that information will be part of it (unless they&#8217;re blank).</p>
<p><a href="http://reinventar.com/wp-content/uploads/2009/03/picture-4.png"><img class="alignleft size-full wp-image-529" title="picture-4" src="http://reinventar.com/wp-content/uploads/2009/03/picture-4.png" alt="picture-4" width="480" height="346" /></a></p>
<p>You can also define this on a global scale for the app (in the config/config.yml file) and that way you can make your app more SEO friendly.</p>
<p><strong>Basic i18n support</strong></p>
<p>This is fairly new to me but I think I did some advances on this part. I defined two locales for the application, so there&#8217;s english and portuguese and i&#8217;ve got 2 yml files in config/locales/ with date formats, numbers, model names, attributes and much more.</p>
<p><a href="http://reinventar.com/wp-content/uploads/2009/03/picture-5.png"><img class="alignleft size-full wp-image-530" title="picture-5" src="http://reinventar.com/wp-content/uploads/2009/03/picture-5.png" alt="picture-5" width="363" height="262" /></a></p>
<p>You can also use this yml file to store your own translations, like the below example:</p>
<p><a href="http://reinventar.com/wp-content/uploads/2009/03/picture-6.png"><img class="alignleft size-full wp-image-531" title="picture-6" src="http://reinventar.com/wp-content/uploads/2009/03/picture-6.png" alt="picture-6" width="502" height="205" /></a></p>
<p>I also got a before_filter setup on the application.rb controller that sets the locale for each request:</p>
<pre lang="ruby">before_filter :set_locale

def set_locale
locale = params[:locale] || 'pt'
I18n.locale = locale
end</pre>
<p>And I got this working for Pages by defining my routes as this:</p>
<pre lang="ruby">map.pages '/pages/:permalink/:locale', :controller=&gt;"pages", :action=&gt;"show", :defaults =&gt; { :locale =&gt; 'pt' }</pre>
<p>This works fine even in the case you didn&#8217;t put the locale in the params.</p>
<p><a href="http://reinventar.com/wp-content/uploads/2009/03/picture-9.png"><img class="alignleft size-full wp-image-532" title="picture-9" src="http://reinventar.com/wp-content/uploads/2009/03/picture-9.png" alt="picture-9" width="325" height="37" /></a></p>
<p>Now all I have to figure out is how to do the same for restful routes and translate the rest of the pages.</p>
<p>Any ideas?</p>
]]></content:encoded>
			<wfw:commentRss>http://reinventar.com/2009/03/baseapp-orange-updated-with-basic-pages-and-i18n-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
