<?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>RubyFreaks &#187; RUBY</title>
	<atom:link href="http://rubyfreaks.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubyfreaks.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 13 May 2010 16:42:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Internationalization(I18n) and Localization(L10n) in Rails</title>
		<link>http://rubyfreaks.com/2009/09/29/internationalizationi18n-and-localizationl10n-in-rails/</link>
		<comments>http://rubyfreaks.com/2009/09/29/internationalizationi18n-and-localizationl10n-in-rails/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 11:49:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RUBY]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://rubyfreaks.com/?p=126</guid>
		<description><![CDATA[Internationalization is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization is the process of adapting internationalized software for a specific region or language by adding locale-specific components and translating text. Due to the length of the words, the terms are frequently [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Internationalization</strong> is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. <strong>Localization</strong> is the process of adapting internationalized software for a specific region or language by adding locale-specific components and translating text.</p>
<p>Due to the length of the words, the terms are frequently abbreviated to the numeronyms i18n (where 18 stands for the number of letters between the first i and last n in internationalization, a usage coined at DEC in the 1970s or 80s[1]) and L10n respectively. The capital L in L10n helps to distinguish it from the lowercase i in i18n.</p>
<div id="wiki-content">
<p><strong>Internationalization and localization instructions</strong></p>
<p id="3c7374726f6e673e6261736963207465726d733c2f7374726f6e673e203c6272202f3e"><strong>Basic Terms</strong> <br/></p>
<p><strong>pot-file:</strong> Text file automatically generated with rake task (rake updatepo) or rgettext that shows all the original messages (msgid) inside the app code. Developers should generate this files and send them to translators as a template to write the po files (translated version of the pot file for a language).</p>
<p><strong>po-file:</strong> Text file which is language-specific. It includes msgid(Original message) and msgstr(Translated message)</p>
<p><strong>mo-file:</strong> Binary Files which are created from po-files with rake task (rake makemo) or rmsgfmt. The <a href="http://http://www.yotabanana.com/hiki/ruby-gettext.html">Ruby-GetText</a>-Package library reads this compiled mo-files, not po-files.</p>
</p>
<p id="66696c65206d61696e74656e616e6365266e6273703b">File Maintenance </p>
<p>To do I18n maintenance, you need to install ruby-gettext-package</p>
<p>As it is not in the gem repository, you need to:<br/>1) Download ruby-gettext-package- from <a href="http://rubyforge.org/frs/?group_id=855&#038;release_id=34790">here</a><br/>2) Extract ruby-gettext-package-<br/>3) Go to the extracted directory and run &#8220;sudo ruby setup.rb&#8221;</p>
<p><strong>How to add a new language?:</strong></p>
<p>1) create language directory inside &#8220;po&#8221; folder (eg: es/)<br/> 2) Go inside new language folder and run: msginit -i ../ur_application_name.pot -o ur_application_name.po</p>
</p>
<p><strong> How to update po files (when new keys are added or modified)?:</strong><br/> 1) Go to app folder and run: rake updatepo</p>
</p>
<p><strong>To recompile files (when you get new/modifed po files translated)</strong><br/> 1) Go to app folder and run: rake makemo</p>
</p>
<p id="266e6273703b686f7720746f20616464266e6273703b206931386e20746f206120706167653f3c6272202f3e"> How to add  i18n to a Page?</p>
<p><br/></p>
<p><strong>Basics</strong></p>
<p>If you want to translate a text. Eg. &#8220;This text&#8221;  You need to simple call _(). E.g _(&#8220;This text&#8221;). </p>
<p>The key will be added to the po file and someone will translate it later. If the key is already in the po file (and compiled in the mo file) it will appear translated. You should choose keys that make sense and that might be reusable. Try not to pick very long  texts as keys.</p>
<ul>
<li>If you need to include arguments to your strings, check: <a href="http://www.yotabanana.com/hiki/ruby-gettext-howto.html#String+with+arguments">http://www.yotabanana.com/hiki/ruby-gettext-howto.html#String+with+arguments </a> </li>
<li>If you need to use plural forms (eg. &#8220;you have 1 new message&#8221;), check:  <a href="http://www.yotabanana.com/hiki/ruby-gettext-howto.html#How+to+use+GetText.n_(msgid%2C+msgid_plural%2C+n)">http://www.yotabanana.com/hiki/ruby-gettext-howto.html#How+to+use+GetText.n_(msgid%2C+msgid_plural%2C+n)</a> </li>
<li>If you need to define constants in the po file, use N_() (eg, attribute accesors in model) you can use N_(&#8220;Password&#8221;). This functions does nothing but allows you to include the key in the po file.</li>
<li>If you need to include a context specific key <em>(eg: &#8220;File|Open&#8221;, &#8220;Printer|Open&#8221;),</em> check s_() function: <a href="http://www.yotabanana.com/hiki/ruby-gettext-howto.html#How+to+use+GetText.s_(msgid%2C+div+%3D+%22|%22)">http://www.yotabanana.com/hiki/ruby-gettext-howto.html#How+to+use+GetText.s_(msgid%2C+div+%3D+%22|%22)</a> </li>
</ul>
<p> <strong>Model: </strong>All field names are automatically added to the po file from the database (whith the rake task). If you need to define constants or translate new error messages, you can use the N_() function. For more information, check: <a href="http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html">http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html</a></p>
</p>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://rubyfreaks.com/2009/09/29/internationalizationi18n-and-localizationl10n-in-rails/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>RoR Begining</title>
		<link>http://rubyfreaks.com/2008/07/10/hello-world-2/</link>
		<comments>http://rubyfreaks.com/2008/07/10/hello-world-2/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 10:37:30 +0000</pubDate>
		<dc:creator>rubyfreaks</dc:creator>
				<category><![CDATA[RUBY]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[rubyonrails]]></category>

		<guid isPermaLink="false">http://rubyfreaks.com/?p=17</guid>
		<description><![CDATA[Ruby on Rails Ruby on Rails is an open source web application framework for the Ruby programming language. It is often referred to as Rails or RoR . It is intended to be used with the Agile development methodology, which is often utilized by web developers for its suitability for short, client-driven projects. Some Cool [...]]]></description>
			<content:encoded><![CDATA[<h2>Ruby on Rails</h2>
<p><strong>Ruby on Rails</strong> is an open source web application framework for the <strong>Ruby</strong> programming language. It is often referred to as <strong>Rails</strong> or<strong> RoR </strong>. It is intended to be used with the Agile development methodology, which is often utilized by web developers for its suitability for short, client-driven projects.</p>
<h2>Some Cool links</h2>
<ul>
<li><a class="external text" title="http://www.rubyonrails.com/" rel="nofollow" href="http://www.rubyonrails.com/">Ruby on Rails official website</a></li>
<li><a class="external text" title="http://www.railslodge.com" rel="nofollow" href="http://www.railslodge.com">RailsLodge plugin directory</a></li>
<li><a class="external text" title="http://rubyforge.org/" rel="nofollow" href="http://rubyforge.org/">Ruby Forge</a></li>
<li><a class="external text" title="http://www.railscasts.com/" rel="nofollow" href="http://www.railscasts.com/">RailsCasts:</a></li>
</ul>
<h2>Books for Ruby on Rails</h2>
<ul>
<li> <a href="http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition">Agile Web Development with Rails</a></li>
<li> <a href="http://www.pragprog.com/titles/fr_arr/advanced-rails-recipes">Rails Recipes</a></li>
</ul>
<h2>Rails Framework Documentation</h2>
<ul>
<li><a href="http://api.rubyonrails.org/">Rails API</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://rubyfreaks.com/2008/07/10/hello-world-2/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
