Module: ZLocalize::Translatable::DefaultLocaleEvaluator::ClassMethods

Defined in:
lib/zlocalize/rails/default_locale_evaluator.rb

Instance Method Summary collapse

Instance Method Details

#set_default_locale_for_translations(value) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/zlocalize/rails/default_locale_evaluator.rb', line 14

def set_default_locale_for_translations(value)
  @@default_locale_for_translations =
    case value
      when nil then nil
      when Symbol, String then value.to_sym
      else
        raise(
          Zigotos::Translatable::TranslationError,
            "default_locale option must be either a String or a Symbol representing a method on this class (trying to set it to a #{value.class.name})"
        )
    end

  include ZLocalize::Translatable::DefaultLocaleEvaluator::InstanceMethods
end