Hi all,
I have a multi-lingual app that has, up until recently, been able to
select the views and layouts according to a language parameter. So I
could select views such as:
root/app/views/post/index.th.html.haml
root/app/views/layouts/application.jp.html.haml
This was done by overriding _template_location as follows:
def _template_location(action, type = nil, controller =
controller_name)
lang = params[:language]
action = "#{action}.#{lang}" unless lang == 'en'
_conditionally_append_extension(controller ? "#{controller}/#
{action}" : "#{action}", type)
end
Recently, though, the layouts are being cached (see commit #) so this
means that my layouts don't get selected according to language
anymore. I then tried to use the 'layout' function in the render mixin
to select the layout but had issues.
There must be some way to easily use views for different languages (as
I don't want to pull huge amounts of text from the DB). How are are
people doing it and then how will Merb 2/Rails 3 do it?
-felix
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---