class LightService::LocalizationAdapter
Public Instance Methods
Source
# File lib/light-service/localization_adapter.rb, line 3 def failure(message_or_key, action_class, options = {}) find_translated_message(message_or_key, action_class.to_s.underscore, options.merge(:type => :failures)) end
Source
# File lib/light-service/localization_adapter.rb, line 9 def success(message_or_key, action_class, options = {}) find_translated_message(message_or_key, action_class.to_s.underscore, options.merge(:type => :successes)) end
Private Instance Methods
Source
# File lib/light-service/localization_adapter.rb, line 17 def find_translated_message(message_or_key, action_class, options) if message_or_key.is_a?(Symbol) LightService::LocalizationMap.instance.dig( LightService::Configuration.locale, action_class.to_sym, :light_service, options[:type], message_or_key ) else message_or_key end end