# (announce) A multi\_lang plugin for views/layouts

**URL:** <https://www.ruby-forum.com/t/announce-a-multi-lang-plugin-for-views-layouts/65779>\
**Category:** Rails I18n\
**Created:** [August 21, 2006, 12:18pm UTC](https://www.ruby-forum.com/t/announce-a-multi-lang-plugin-for-views-layouts/65779 "2006-08-21T12:18:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabien\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6bbea6/32.png) [@Fabien\_P](https://www.ruby-forum.com/u/Fabien_P)\
**Post date:** [August 21, 2006, 12:18pm UTC](https://www.ruby-forum.com/t/announce-a-multi-lang-plugin-for-views-layouts/65779/1 "2006-08-21T12:18:50Z")

</div>

Hi all.

I needed a plugin to display different pages depending of the  
browser’s language. Not something for the code (“gettext like” plugins  
are fine for that) but more like being able to have different views  
files to make my life easy when I write a website.

You can check the plugin at  
[http://penso.info/svn/rails/plugins/multi\_lang/](http://penso.info/svn/rails/plugins/multi_lang/)

(feedbacks and criticises are more than welcome)

At first I wanted to make something that worked with apache/multiviews  
too if you used caches\_page, but after spending hours on that I  
figured it out that it would be very difficult with the current way  
rails works with caches\_pages. I ended up with this plugin which does  
the job. It will work also if you use apache, but rails will detect  
the language, not multiviews.

---

<div class="post-metadata">

**Author:** ![Fabien\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6bbea6/32.png) [@Fabien\_P](https://www.ruby-forum.com/u/Fabien_P)\
**Post date:** [August 21, 2006, 3:25pm UTC](https://www.ruby-forum.com/t/announce-a-multi-lang-plugin-for-views-layouts/65779/2 "2006-08-21T15:25:23Z")

</div>

Hi,

Ruby-GetText-Package already has same feature.

The difference is the view’s path.

- app/views/blog/foo\_fr.rhtml (for French)
- app/views/blog/foo.rhtml (for others. you can use \_(“”) style in  
it, too.)

See:  
[http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Localized+templates+for+Views%2FActionMailer](http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Localized+templates+for+Views%2FActionMailer)

On Mon, 21 Aug 2006 12:16:45 +0200

---

<div class="post-metadata">

**Author:** ![Fabien\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6bbea6/32.png) [@Fabien\_P](https://www.ruby-forum.com/u/Fabien_P)\
**Post date:** [August 21, 2006, 3:43pm UTC](https://www.ruby-forum.com/t/announce-a-multi-lang-plugin-for-views-layouts/65779/3 "2006-08-21T15:43:26Z")

</div>

On 8/21/06, Masao M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> Ruby-GetText-Package already has same feature.
> 
> The difference is the view’s path.

Ah, I missed that feature… I guess I just lost few hours writing  
mine then. Thanks for the info.
