# Recommendations for localization on Ruby 1.9?

**URL:** <https://www.ruby-forum.com/t/recommendations-for-localization-on-ruby-1-9/160203>\
**Category:** Ruby\
**Created:** [February 12, 2009, 11:01pm UTC](https://www.ruby-forum.com/t/recommendations-for-localization-on-ruby-1-9/160203 "2009-02-12T23:01:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [February 12, 2009, 11:01pm UTC](https://www.ruby-forum.com/t/recommendations-for-localization-on-ruby-1-9/160203/1 "2009-02-12T23:01:15Z")

</div>

Hi folks,

I am researching localization techniques for the ‘Reducing Cultural  
Barriers’ chapter in my book. Does anyone have experience with a  
library they like which works on Ruby 1.9?  
Although I have some experience with the m17n framework in Ruby 1.9, I  
don’t know a lot about localization tools, which is the other side of  
the internationalization coin.  
Any suggestions would be welcome!

-greg

PS: If there aren’t good tools out there for this already and you have  
a hand rolled solution, I’d be happy to look at that too.

---

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [February 13, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/recommendations-for-localization-on-ruby-1-9/160203/2 "2009-02-13T18:03:54Z")

</div>

Gregory B. wrote:

> Although I have some experience with the m17n framework in Ruby 1.9, I  
> don’t know a lot about localization tools, which is the other side of  
> the internationalization coin.

What do you mean by localization tools? GUIs or text editor plugins  
that make it easy to edit GNU gettext .po translation files? There’s  
lots of those on [http://freshmeat.net](http://freshmeat.net)

> If there aren’t good tools out there for this already and you have  
> a hand rolled solution, I’d be happy to look at that too.

I have[1](http://snk.tuxfamily.org/lib/inochi/#Translate-your-project) a very simple hand-rolled solution (a Hash with a  
Kernel#sprintf interface) which ignores character encoding at the moment  
because I’ve been relying on YAML to detect & handle the encoding  
issues—so far it works great for Unicode and the latin ISO charsets.

I’ve used this solution successfully in two projects; one of them for  
~1.5 years. Someday I’ll factor in Ruby 1.9’s character encoding  
abilities, but that may not be necessary if YAML beats me to it. 🙂

---

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [February 13, 2009, 6:30pm UTC](https://www.ruby-forum.com/t/recommendations-for-localization-on-ruby-1-9/160203/3 "2009-02-13T18:30:00Z")

</div>

On Fri, Feb 13, 2009 at 12:02 PM, Suraj K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Gregory B. wrote:
> 
> > Although I have some experience with the m17n framework in Ruby 1.9, I  
> > don’t know a lot about localization tools, which is the other side of  
> > the internationalization coin.
> 
> What do you mean by localization tools? GUIs or text editor plugins  
> that make it easy to edit GNU gettext .po translation files? There’s  
> lots of those on [http://freshmeat.net](http://freshmeat.net)

No, I mean libraries for handling translation files within an  
application.

> > If there aren’t good tools out there for this already and you have  
> > a hand rolled solution, I’d be happy to look at that too.
> 
> I have[1] a very simple hand-rolled solution (a Hash with a  
> Kernel#sprintf interface) which ignores character encoding at the moment  
> because I’ve been relying on YAML to detect & handle the encoding  
> issues—so far it works great for Unicode and the latin ISO charsets.

Thanks for sharing. I really want to show something that doesn’t  
ignore character encoding if possible, but I could look into this if  
there aren’t better options.

-greg

---

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [February 14, 2009, 6:01am UTC](https://www.ruby-forum.com/t/recommendations-for-localization-on-ruby-1-9/160203/4 "2009-02-14T06:01:04Z")

</div>

Gregory B. wrote:

> On Fri, Feb 13, 2009 at 12:02 PM, Suraj K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Gregory B. wrote:
> > 
> > > Although I have some experience with the m17n framework in Ruby 1.9, I  
> > > don’t know a lot about localization tools, which is the other side of  
> > > the internationalization coin.  
> > > What do you mean by localization tools? GUIs or text editor plugins  
> > > that make it easy to edit GNU gettext .po translation files? There’s  
> > > lots of those on [http://freshmeat.net](http://freshmeat.net)
> 
> No, I mean libraries for handling translation files within an application.

If by “handling” translation files you mean marking translatable strings  
and having them replaced when an application runs, then ruby-gettext  
works fine for me with 1.9. I use it with a wxRuby app, but the  
documentation suggests it can also be used for Rails.

[http://www.yotabanana.com/hiki/ruby-gettext.html](http://www.yotabanana.com/hiki/ruby-gettext.html)

a

---

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [February 14, 2009, 3:28pm UTC](https://www.ruby-forum.com/t/recommendations-for-localization-on-ruby-1-9/160203/5 "2009-02-14T15:28:30Z")

</div>

On Fri, Feb 13, 2009 at 11:58 PM, Alex F.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> If by “handling” translation files you mean marking translatable strings and  
> having them replaced when an application runs, then ruby-gettext works fine  
> for me with 1.9. I use it with a wxRuby app, but the documentation suggests  
> it can also be used for Rails.
> 
> [http://www.yotabanana.com/hiki/ruby-gettext.html](http://www.yotabanana.com/hiki/ruby-gettext.html)

Yep, somehting along the lines of ruby-gettext is what I’m looking  
for. I’ll need to try it out on 1.9, but in the mean time, does  
anyone else have any experiences with this lib or other ones?

Thanks Alex for suggesting this.

-greg
