(announce) A multi_lang plugin for views/layouts

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/

(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.

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

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

On 8/21/06, Masao M. [email protected] 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.