This project is archived and is in readonly mode.

#1886 ✓resolved
José Valim

HTML fallback when format is :js should be also localized

Reported by José Valim | February 5th, 2009 @ 06:00 PM

The current implementation of localized templates on rails/actionpack/lib/action_view/paths.rb is incomplete.

At line 48, in the method find_template, when we check for a html file if the format is js, we should try first to find the localized version of this file. So what we have now as:


  # Try to find html version if the format is javascript
  elsif format == :js && template = load_path["#{template_path}.html"]
    return template
  end

Should actually be:


  # Try to find html version if the format is javascript
  elsif format == :js && template = load_path["#{template_path}.#{I18n.locale}.html"]
    return template
  elsif format == :js && template = load_path["#{template_path}.html"]
    return template
  end

I'm not building a patch, since it's a quick fix.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages