Heroku language locale not working
It seeems like my language locale on heroku is not working.
On my local mashine : 1. maj
Heroku : 01 May 00:00
My view:
<%= l vind.udtraekkes, :format => :short %>
Locale:
en:
hello: "Hello world"
views:
pagination:
previous: "« Tilbage"
next: "Næste side »"
# active_support
date:
# See http://sproget.dk/svarbase/SV00000046/ and http://en.wikipedia.org/wiki/Date_formats
# either use traditional (2.10.03, 2. oktober 2003): "%e.%m.%y", "%e. %B %Y"
# or international ISO 8601 format (2003-10-20): "%Y-%m-%d"
# Note: some Windows distributions do not support %e - you may have to use %d instead
formats:
default: "%d.%m.%Y"
short: "%e. %b"
long: "%e. %B %Y"
day_names: [søndag, mandag, tirsdag, onsdag, torsdag, fredag, lørdag]
abbr_day_names: [sø, ma, ti, 'on', to, fr, lø] # Note: unescaped 'on' is parsed as true
开发者_开发问答 month_names: [~, januar, februar, marts, april, maj, juni, juli, august, september, oktober, november, december]
abbr_month_names: [~, jan, feb, mar, apr, maj, jun, jul, aug, sep, okt, nov, dec]
order:
- :day
- :month
- :year
time:
formats:
default: "%e. %B %Y, %H:%M"
short: "%e. %B"
long: "%A, %e. %B %Y, %H:%M"
am: ""
pm: ""
I had a problem that could very well have been the same.
I fixed it by taking out the byte order mark from the localization files.
More info in the question I opened: heroku not loading language file
Your locale data is for English (en) but your strings are, I think, Norwegian (no). What locale is your application running as? What language is your browser asking for? What happens if you add an no:
section for the Norwegian?
As a wild guess I'd think that you application ends up trying to use the Norwegian locale but it can't find any configuration for Norwegian so it uses the hard-coded en_US stuff as a fallback. I'd also guess that everything works out on your machine because the default fall-back locale is no_NO; what happens on your local machine if you change the short date format in your en:
locale section?
More guesses that answers here but this was a little too big and involved for a comment.
精彩评论