Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class ApplicationController < ActionController::Base
helper_method :current_user
helper_method :current_service

before_action :set_locale
before_action :accept_terms, if: :logged_in?

def render_not_found
Expand Down Expand Up @@ -131,11 +130,6 @@ def has_access?

private

def set_locale
store_locale_to_cookie(params[:locale]) if locale
I18n.locale = cookies[:locale] || I18n.default_locale
end

def user_not_authorized
redirect_to(user_path, notice: 'You are not authorized to perform this action.')
end
Expand All @@ -155,13 +149,4 @@ def redirect_back(fallback_location:, **args)
redirect_to fallback_location, **args
end
end

def store_locale_to_cookie(locale)
cookies[:locale] = { value: locale,
expires: Time.zone.now + 36_000 }
end

def locale
params[:locale] if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
end
end
2 changes: 1 addition & 1 deletion config/initializers/locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
Rails.application.config.i18n.default_locale = :en
Rails.application.config.i18n.fallbacks = true
Rails.application.config.i18n.available_locales = [:en, :fr, :de]
Rails.application.config.i18n.available_locales = [:en]
#config.i18n.enforce_available_locales = false
46 changes: 0 additions & 46 deletions config/locales/admin.de.yml

This file was deleted.

46 changes: 0 additions & 46 deletions config/locales/admin.en_AU.yml

This file was deleted.

46 changes: 0 additions & 46 deletions config/locales/admin.en_GB.yml

This file was deleted.

46 changes: 0 additions & 46 deletions config/locales/admin.en_US.yml

This file was deleted.

46 changes: 0 additions & 46 deletions config/locales/admin.es.yml

This file was deleted.

46 changes: 0 additions & 46 deletions config/locales/admin.fi.yml

This file was deleted.

46 changes: 0 additions & 46 deletions config/locales/admin.fr.yml

This file was deleted.

Loading