Module: Celsius::I18n::ClassMethods

Defined in:
lib/celsius/i18n.rb

Instance Method Summary collapse

Instance Method Details

#load_locales_from_directory(path) ⇒ Object



14
15
16
17
18
19
# File 'lib/celsius/i18n.rb', line 14

def load_locales_from_directory(path)
  # class_variable_get is needed to avoid implicite referencing the module instead of the including class
  Dir.glob("#{File.expand_path(path)}/*.yml").inject(self.class_variable_get(:@@locales)) do |locales, filename|
    DeepMerger.deep_merge!(locales, YAML.load_file(filename))
  end
end