Gemfile:
gem 'http_accept_language'
config/initializers/locale.rb:
# tell the I18n library where to find your translations
I18n.load_path += Dir[Rails.root.join('lib', 'locale', '*.{rb,yml}')]
I18n.available_locales = [ :en, :ko ]
# set default locale to something other than :en
# I18n.default_locale = :pt
config/application.rb
class ApplicationController < ActionController::Base
include HttpAcceptLanguage::AutoLocale
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end