yes, I copy and paste here an email I sent about 3 weeks ago to the 
globalize mailing list:

------------------------
Hi,

I'm having problem with globalize (for-1.1, revision 199) and actionview 
combined with MimeResponds.

This is my, hopefully not too wrong, analysis:

Responders in MimeResponds (
actionpack-1.12.5/lib/action_controller/mime_responds.rb
) work rendering a template_path that includes extension, for example
template.rxml, template.rhtml, etc.

ActionView::Base in globalize (
globalize/lib/globalize/rails/action_view.rb
) passes this kind of templates to pick_template_extension (line 29) and 
this throws an exception.
To workaround this problem, one can borrow code from rails 1.1 
ActionView::Base#render_file and substitute

if use_full_path
           template_extension = pick_template_extension(template_path).to_s
           template_file_name = full_template_path(template_path, 
template_extension)

with

if use_full_path
       template_extension = nil
           template_path_without_extension, template_extension = 
path_and_extension(template_path)
           if template_extension
             template_file_name = 
full_template_path(template_path_without_extension, template_extension)
           else
             template_extension = 
pick_template_extension(template_path).to_s
             template_file_name = full_template_path(template_path, 
template_extension)
           end

This works well in controllers but, unfortunately, completely breaks the 
globalize action_mailer_test because of the content type "extensions" 
added by globalize.
Example:
passed value -> test.en.plain.text
expected template -> test.en.plain.text.rhtml
but path_and_extension cuts text and search
test.en.plain.rhtml -> exception.

What are your thoughts?
Thanks in advance.
------------------------

Unfortunately nobody has replied :-( , anyway I suppose that you could 
solve your problems with the proposed modifications in 
globalize/lib/globalize/rails/action_view.rb

By the way, to work out the consequent problems with ActionMailer, 
perhaps Globalize should use _ as separator, as gettext does (
http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Localized+templates+for+Views%2FActionMailer
)

Best regards
-- 
Nicola Piccinini -- http://superfluo.org
_______________________________________________
Railsi18n-discussion mailing list
Railsi18n-discussion@rubyforge.org
http://rubyforge.org/mailman/listinfo/railsi18n-discussion

Reply via email to