Forum: Ruby on Rails Yet Another Rails Translation System

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and 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:// ), 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:

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


This topic is locked and can not be replied to.