Hi Karel,

> This "automagic" filling of locale `:prefix` in routes would be
> *really great* to have.

My translated_routes plugin[1] does this kind of filling on a
different way: it generates a helper for each localized route and
replaces the original one with a dinamic one which calls the
appropiate helper. An example will explain this better than my words:
- let's say you have generated a users_path helper, and two locales:
en_US and fr_FR
- the plugin generates two helpers: users_en_us_path and
users_fr_fr_path, with their corresponding locale's param value
- the plugin replaces the original users_path helper by some code
which calls users_en_us_path if the current locale is en-US and
users_fr_fr_path if the current locale is fr-FR.

Of course all this code generation and replacement is done after
routes generation (i.e: when the app starts), so there are no serious
performance penalties once the app is working.

If somebody is interested, I have just released a new branch[2] of the
plugin, now Rails2.2-oriented to support your I18n translation API,
which is *very cool* by the way: thanks so much guys! :)

Best regards,

-- 
Raul Murciano - Freelance Web Developer
http://raul.murciano.net

[1] http://github.com/raul/translate_routes/tree/master
[2] http://github.com/raul/translate_routes/tree/rails2.2

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rails-i18n" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rails-i18n?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to