This project is archived and is in readonly mode.

#1888 ✓resolved
José Valim

Localized templates does not work with "pt-BR" or "en-US" as locale

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

Localized templates is not working when the locale contains a dash "-" (for example and show.en-US.html.erb).

The reason of it is on rails/actionpack/lib/action_view/template.rb.

On line 239 we see the regexp that process our extensions in our view path is

    m = extensions.match(/^(\w+)?\.?(\w+)?\.?(\w+)?\.?/) 

The first parenthesis, which is the one that checks for the locale does not accepts dash -.

A working regexp would be:


And we can see it working on Rubular:

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=""></a>

People watching this ticket

Referenced by