Added translations to entire app
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
before_action :set_locale
|
||||
|
||||
private
|
||||
|
||||
def set_locale
|
||||
I18n.locale = params[:locale] || session[:locale] || I18n.default_locale
|
||||
session[:locale] = I18n.locale
|
||||
end
|
||||
|
||||
# Optional: Make locale persist across requests via URL helpers
|
||||
def default_url_options
|
||||
{ locale: I18n.locale }
|
||||
end
|
||||
|
||||
def set_company
|
||||
company_id = session.fetch(:company_id, Company.first&.id)
|
||||
session[:company_id] = company_id
|
||||
|
||||
Reference in New Issue
Block a user