this is my application_controller.rb file
private
def default_url_options
{ locale: I18n.locale }
end
def set_locale
I18n.locale = extract_locale || I18n.default_locale
end
def extract_locale
parsed_locale = params[:locale]
I18n.available_locales.map(&:to_s).include?(parsed_locale) ? parsed_locale.to_sym : nil
end```
This is my route.rb file
scope "(:locale)", locale: /#{I18n.available_locales.join("|")}/ do
get 'careers' => 'pages#careers', :as => :careers
end