1

它看起来像我的语言区域设置在heroku上无法正常工作。Heroku语言区域设置不起作用

On my local mashine : 1. maj 
Heroku    : 01 May 00:00 

我的观点:

<%= l vind.udtraekkes, :format => :short %> 

区域设置:

en: 
    hello: "Hello world" 
    views: 
    pagination: 
     previous: "&laquo; Tilbage" 
     next: "Næste side &raquo;" 
     # 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: "" 
+0

我的问题清楚了吗? – 2011-03-22 10:08:40

回答

0

您的区域数据是英语(en),但你的字符串是,我认为,挪威(无)。您的应用程序以什么语言环境运行?你的浏览器要求什么语言?如果您为挪威语添加no:部分,会发生什么情况?

作为一个疯狂的猜测,我认为你的应用程序最终试图使用挪威的语言环境,但它无法找到挪威的任何配置,因此它使用硬编码的en_US作为后备。我也猜测你的机器上的所有东西都可以运行,因为默认的回退语言环境是no_NO;如果在en:区域设置部分中更改短日期格式,本地计算机上会发生什么?

更多的猜测,在这里回答,但这是有点太大,并参与评论。

+0

我得到错误ActionView :: Template :: Error(翻译m issing:da.time.formats.short) – 2011-03-22 19:20:57

+0

如果你设置你的'en.yml'英文的东西,添加一个'no.yml'会发生什么你现在在'en.yml'中有什么,然后设置'config.i18n.default_locale =:no'?你的问题开始看起来像这样:http://stackoverflow.com/questions/2782007/heroku-and-i18n-problems – 2011-03-23 02:11:15

2

我有一个问题,很可能是一样的。

我通过从本地化文件中取出字节顺序标记来修复它。

更多的信息在我打开的问题:heroku not loading language file

相关问题