Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.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 Rails—RouteTranslator Gem—生成的语言太多_Ruby On Rails_Ruby On Rails 4 - Fatal编程技术网

Ruby on rails Rails—RouteTranslator Gem—生成的语言太多

Ruby on rails Rails—RouteTranslator Gem—生成的语言太多,ruby-on-rails,ruby-on-rails-4,Ruby On Rails,Ruby On Rails 4,又是Rails的一天。。。 我试过这个。我已经完成了从1到4的步骤,但是当我运行rake routes命令时。我看到rake为更多6种语言生成了路由!像fr,de,cs,nl,。。。但我只本地化了两种语言:英语和匈牙利语。我没有为其他语言创建任何translation.yml文件 Rails.application.routes.draw do # The priority is based upon order of creation: first created -> highes

又是Rails的一天。。。 我试过这个。我已经完成了从1到4的步骤,但是当我运行rake routes命令时。我看到rake为更多6种语言生成了路由!像fr,de,cs,nl,。。。但我只本地化了两种语言:英语和匈牙利语。我没有为其他语言创建任何translation.yml文件

Rails.application.routes.draw do
  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".
  localized do
    resources :partners
    resources :school_reviews, except: [:edit]
    resources :schools
    resources :events

    # Authentication
    devise_for :users, :controllers => { 
        omniauth_callbacks: "users/omniauth_callbacks", registrations: 'registrations'
    }
    devise_scope :user do
      get 'sign_up_with_school' => 'registrations#new_with_school', as: 'sign_up_with_school'
      post 'sign_up_with_school' => 'registrations#create_with_school', as: 'create_with_school'
    end
  end
end
我只定义了匈牙利语翻译: 胡: 路线: 新名称:uj 创建:letrehozas 编辑:szerkesztes 摧毁:圆环 合作伙伴:partnerek 学校评论:伊斯科莱·维勒曼耶克 学校:伊斯科拉克 活动:esemnyek

也许是其他的宝石导致了这6种语言?如何禁用fr、de、cs和其他语言?

好的,我已经解决了。 必须在环境中添加此行

config.i18n.available_locales=[:en,:hu]