Added translations to entire app

This commit is contained in:
2025-04-23 07:45:33 +02:00
parent ce947100c6
commit 58e78acbba
22 changed files with 450 additions and 132 deletions

View File

@@ -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