Note that there are some explanatory texts on larger screens.

plurals
  1. PODevise looking for wrong locale on Rails 4.0.2
    primarykey
    data
    text
    <p>I've just updated to Rails 4.0.2 and I got the deprecation warning:</p> <pre><code>[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. </code></pre> <p>To get rid of the warning, I decided to set: </p> <pre><code>I18n.config.enforce_available_locales = true </code></pre> <p>in my <strong>config/application.rb</strong> file.</p> <p>It worked pretty well on Development, all tests passed, and I was happy... Then I deployed my work in a staging server and it crashed!</p> <p>Devise is looking for a locale <strong>:pt</strong>. All I have is a locale <strong>:pt-BR</strong>. I set it in my <strong>application.rb</strong>:</p> <pre><code>config.i18n.default_locale = 'pt-BR' </code></pre> <p>I don't know why devise is looking for <strong>:pt</strong> only. My locales in the <strong>config</strong> folder are: <strong>pt-BR.yml</strong> and <strong>devise.pt-BR.yml</strong>.</p> <p>I tried to change the file name from <strong>devise.pt-BR.yml</strong> to <strong>devise.pt.yml</strong> (and inside from pt-BR to pt) and it worked.</p> <p>I had to go back and set:</p> <pre><code>I18n.config.enforce_available_locales = false </code></pre> <p>to make it work.</p> <p>I have two questions:</p> <p>1 - Why this is not happening on the tests and on development?</p> <p>2 - Why Devise is asking for <strong>:pt</strong>, if I'm setting the default locale as <strong>:pt-BR</strong> in my config?</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload