Skip to content

Commit f8d6844

Browse files
committed
Fix NameError (undefined local variable or method current_user_language)
1 parent 83fb4a0 commit f8d6844

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/message_customize/application_controller_patch.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ def self.included(base)
1212
module InstanceMethod
1313
def reload_customize_messages
1414
custom_message_setting = CustomMessageSetting.find_or_default
15-
# NOTE: ApplicationController#set_localization sets the appropriate language in I18n.locale
16-
return if custom_message_setting.latest_messages_applied?(I18n.locale)
15+
return if custom_message_setting.latest_messages_applied?(current_user_language)
1716

18-
MessageCustomize::Locale.reload!([I18n.locale])
17+
MessageCustomize::Locale.reload!([current_user_language])
18+
end
19+
20+
private
21+
22+
# NOTE: ApplicationController#set_localization sets the appropriate language in I18n.locale
23+
def current_user_language
24+
I18n.locale
1925
end
2026
end
2127
end

0 commit comments

Comments
 (0)