# Localisation - Looking for a straight-forward solution

**URL:** <https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367>\
**Category:** Rails I18n\
**Created:** [January 8, 2007, 3:13pm UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367 "2007-01-08T15:13:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [January 8, 2007, 3:13pm UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367/1 "2007-01-08T15:13:40Z")

</div>

Hello there.

I’m looking for a localisation plugin that is:

- easy to use (like java’s ressource bundle for instance)
- flexible enough\*
- fast
- well documented

\*My requirements in detail:

- I want to take care of my database schema on my own (don’t want a  
autom. handling like globalize)
- It should not torture my database; a file-based solution (with caching  
in memory) would be appreciated
- Multiple languages per site required - but not necessarily per page
- nice to have: The choise of the active language for a request should  
be up to me; not handled automatically
- Unicode should be possible
- Rails 1.16, 1.2 compatible
- should work with fragment/action/page caching
- would like to have a routing like: [site.com/:lang/:controller/:action](http://site.com/:lang/:controller/:action)
- translation of rails error messages and stuff
- translation of model and attribute names (in error messages) would be  
appreciated

However I’m still not sure if it’s preferable to have multiple rhtmls  
per language or to have just one with multiple calls to something like  
“getText(XXXX)”. I could image that the multiple rhtml-solution is more  
flexible and possibly faster. What do you think or what are you  
experiences?

Thanks…  
David

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [February 11, 2007, 11:40am UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367/2 "2007-02-11T11:40:15Z")

</div>

I’m using this, works.

[http://wiki.rubyonrails.org/rails/pages/Localization+Plugin](http://wiki.rubyonrails.org/rails/pages/Localization+Plugin)

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [February 11, 2007, 2:49pm UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367/3 "2007-02-11T14:49:17Z")

</div>

Hi. Sounds like GLoc would be a good fit for those requirements.  
However regarding the points:

- translation of rails error messages and stuff
- translation of model and attribute names (in error messages) would be  
appreciated  
you would have to do that yourself.

Golly

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [February 13, 2007, 11:44am UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367/4 "2007-02-13T11:44:14Z")

</div>

Thanks god Gloc 1.2 is out:-)

It’s my last hope.

Thanks…  
David

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [February 13, 2007, 1:07pm UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367/5 "2007-02-13T13:07:49Z")

</div>

Great to hear. Hope it’s what you’re looking for. 🙂

Golly

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [February 26, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367/6 "2007-02-26T15:46:54Z")

</div>

Yes, indeed. k Thnx!!

However I have one thing that is in conflict with my requirements: As I  
can see it does not work with caching very well.

Do you use caching in your web-apps?

Regards  
//David

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [February 28, 2007, 12:42pm UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367/7 "2007-02-28T12:42:13Z")

</div>

I have no idea. Actually I’m using the RESTful versions. Therefore the  
cache is organised like  
/tmp//:resource/:id/:sub\_resource/:id.cache

How can the url\_for modify the cache-filename?

THX  
David

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [February 27, 2007, 11:30pm UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367/8 "2007-02-27T23:30:47Z")

</div>

Hi. Yes, I’ve used it with caching without any problems. You know how  
you use a url\_for style hash to identify the cached filename, just add  
:lang =\> current\_language to it.

Golly

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [March 2, 2007, 12:50am UTC](https://www.ruby-forum.com/t/localisation-looking-for-a-straight-forward-solution/81367/9 "2007-03-02T00:50:09Z")

</div>

You’ll have to look up the rails api or google it but i remember that  
methods like cache(), expire\_fragment(), cache\_page() accept url\_for  
params. I’d give u more help but I’ve been programming in Java for the  
last month or two so it feels like a while since I touched ruby on  
rails.

Golly
