Class: IsoDoc::Iso::I18n

Inherits:
IsoDoc::I18n
  • Object
show all
Defined in:
lib/isodoc/iso/i18n.rb

Instance Method Summary collapse

Instance Method Details

#iso_load_file(fname) ⇒ Object

name iso_load_file instead of load_file so that child flavours cannot inherit it and override it



6
7
8
9
# File 'lib/isodoc/iso/i18n.rb', line 6

def iso_load_file(fname)
  f = File.join(File.dirname(__FILE__), fname)
  File.exist?(f) ? YAML.load_file(f) : {}
end

#load_yaml1(lang, script) ⇒ Object



11
12
13
14
15
# File 'lib/isodoc/iso/i18n.rb', line 11

def load_yaml1(lang, script)
  y = iso_load_file("i18n-#{yaml_lang(lang, script)}.yaml")
  y.empty? and return iso_load_file("i18n-en.yaml").deep_merge(super)
  super.deep_merge(y)
end