Is an interest of Rails Core to have Localized Templates? It would look for the locale set and try to load the template based on the locale. So rendering an action called index when locale is "fr", it would first search for the file "index.fr.html.erb". If it''s not found, it will load the default "index.html.erb". Then we could have different files for each locale: index.fr.html.erb index.pt-br.html.erb index.it.html.erb Another correlated feature is Localized Rescue, that would allow the same with 404.html e 500.html files on public dir. I''ve been using and collaborating to a localization plugin called Simple Localization (http://simple-localization.arkanis.de/) where those features were implemented a long time ago and are working perfectly. Complexity and performance won''t be a problem since Rails cache templates filename in an array and we will just have to check for the locale filenames in the array. I''m prone to implement such features and create tests if it''s a main interest! Regards! José Valim. http://www.pagestacker.com/ http://josevalim.blogspot.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> I''m prone to implement such features and create tests if it''s a main > interest!I''m a little scared to add that for this release cycle. But we could investigate making sure it''s easy for you to add it to the template locating code through a plugin? Before we added anything l10n related I''d want to let the new i18n stuff bake for a release or two. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hey José, over at rails-i18n [1] we definitely have an interest in this feature. We just haven''t had any time to investigate that, yet. It''s kind of on our list for the next "I18n''ize Rails dev cycle", which would involve implementing the feature as a plugin first, have it battle-tested and then finally look at it in the context of other or related solutions (if any) and _maybe_ get a core patch ready. So, it would be awesome if you''d register. We''d certainly help out if we can. [1] http://groups.google.com/group/rails-i18n On 10.08.2008, at 11:48, José Valim wrote:> > Is an interest of Rails Core to have Localized Templates? > > It would look for the locale set and try to load the template based on > the locale. So rendering an action called index when locale is "fr", > it would first search for the file "index.fr.html.erb". If it''s not > found, it will load the default "index.html.erb". > > Then we could have different files for each locale: > > index.fr.html.erb > index.pt-br.html.erb > index.it.html.erb > > Another correlated feature is Localized Rescue, that would allow the > same with 404.html e 500.html files on public dir. > > I''ve been using and collaborating to a localization plugin called > Simple Localization (http://simple-localization.arkanis.de/) where > those features were implemented a long time ago and are working > perfectly. > > Complexity and performance won''t be a problem since Rails cache > templates filename in an array and we will just have to check for the > locale filenames in the array. > > I''m prone to implement such features and create tests if it''s a main > interest! > > Regards! > > José Valim. > http://www.pagestacker.com/ > http://josevalim.blogspot.com/ > >-- sven fuchs svenfuchs@artweb-design.de artweb design http://www.artweb-design.de grünberger 65 + 49 (0) 30 - 47 98 69 96 (phone) d-10245 berlin + 49 (0) 171 - 35 20 38 4 (mobile) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---