Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Heroku语言区域设置不工作_Ruby On Rails_Ruby On Rails 3_Postgresql_Localization_Heroku - Fatal编程技术网

Ruby on rails Heroku语言区域设置不工作

Ruby on rails Heroku语言区域设置不工作,ruby-on-rails,ruby-on-rails-3,postgresql,localization,heroku,Ruby On Rails,Ruby On Rails 3,Postgresql,Localization,Heroku,我在heroku上的语言环境似乎不起作用 On my local mashine : 1. maj Heroku : 01 May 00:00 我的看法是: <%= l vind.udtraekkes, :format => :short %> 您的语言环境数据是英语(en),但我认为您的字符串是挪威语(no)。您的应用程序以什么语言环境运行?您的浏览器要求使用哪种语言?如果为挪威语添加no:部分,会发生什么情况 作为一个粗略的猜测,我认为您的应用

我在heroku上的语言环境似乎不起作用

On my local mashine : 1. maj
Heroku              : 01 May 00:00
我的看法是:

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

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

作为一个粗略的猜测,我认为您的应用程序最终尝试使用挪威语言环境,但它找不到挪威语言的任何配置,因此它使用硬编码的en_US内容作为后备。我还猜想,在您的机器上一切都正常,因为默认的回退区域设置是no\u no;如果更改
en:
locale部分中的短日期格式,本地计算机上会发生什么情况


更多的猜测回答了这个问题,但这有点太大了,涉及到评论。

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

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


我打开的问题中的更多信息:

我得到了错误操作视图::模板::错误(翻译错误:da.time.formats.short)如果你用英语材料设置你的
en.yml
,用你当前的
en.yml
添加一个
no.yml
,会发生什么,然后设置
config.i18n.default\u locale=:no
?您的问题开始像这样:
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: ""