Module: LcpRuby::Controller::LocaleBinding

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
lib/lcp_ruby/controller/locale_binding.rb

Overview

Automatic per-request I18n.locale resolution for both authenticated resource pages and anonymous auth pages. Resolution order (first non-nil):

1. current_user.profile[:locale] (if logged in and value is a known locale)
2. Accept-Language header — first 2-letter prefix in I18n.available_locales
3. I18n.default_locale

Uses around_action + I18n.with_locale so the override is always torn down after the request, regardless of thread reuse.