Class: IsoDoc::Iso::I18n

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

Instance Method Summary collapse

Instance Method Details

#load_file(fname) ⇒ Object



4
5
6
7
# File 'lib/isodoc/iso/i18n.rb', line 4

def load_file(fname)
  YAML.load_file(File.join(File.dirname(__FILE__), fname)) ||
    {}
end

#load_yaml1(lang, script) ⇒ Object

all gems inheriting from ISO need to be represented here, even if the file is empty e.g. JA for metanorma-jis



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/isodoc/iso/i18n.rb', line 12

def load_yaml1(lang, script)
  y = if lang == "en" then load_file("i18n-en.yaml")
      elsif lang == "fr" then load_file("i18n-fr.yaml")
      elsif lang == "ru" then load_file("i18n-ru.yaml")
      elsif lang == "ja" then load_file("i18n-ja.yaml")
      elsif lang == "zh" && script == "Hans"
        load_file("i18n-zh-Hans.yaml")
      else load_file("i18n-en.yaml")
      end
  super.deep_merge(y)
end