Another day with Rails... I have tried this RouteTranlsator Gem . I have done the steps from 1st to 4th but when I run rake routes
command. I see that the rake generated routes for more 6 languages! Like fr, de, cs, nl,... But I localized only two languages: en (english) and hu (hungarian). I did not create any translation .yml files for the other languages!
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
And I defined only hu (hungarian) translations: hu: routes: new: uj create: letrehozas edit: szerkesztes destroy: torles partners: partnerek school_reviews: iskolai_velemenyek schools: iskolak events: esemnyek
Maybe some other gems cause this more 6 languages? How can I disable the fr, de, cs and other languages?
Ok, I have solved it. This line has to be added in environments.
config.i18n.available_locales = [:en, :hu]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.