Forum: Ruby on Rails Yet Another Rails Translation System

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ben S. (Guest)
on 2007-01-06 20:30
(Received via mailing list)
The forthcoming Rails 1.2 addresses the multi-byte text part of the
i18n problem, but not the translation part. I've been looking for a
nice simple way to do things, but haven't found anything which feels
quite right so far.

Inspired by Thomas F.' minimalist translation script ( http://
mir.aculo.us/2005/10/03/ruby-on-rails-i18n-revisited ), I've created
yet another translation system.

This differs from the gettext _() approach:

* Unobtrusive format in templates: ``To translate'' rather than <%= _
('To translate') %>

* The string lookup is done once per template at compile time for a
more efficient system: no repeated lookups on every request.

* The translated bits can contain code, like ``To translate with a <%
= number %> of items'' so order of the inserts can be modified.

* You can refer to text by a symbol so translations aren't lost when
you make minor changes to the text. ``:symbol The text to translate''

More details, the code, and a sample app, here:

   http://www.fluffy.co.uk/rails-translation/

I would appreciate comments on this approach before I start using it
in my app!

Thanks,

Ben
This topic is locked and can not be replied to.