Class: IsoDoc::I18n
- Inherits:
-
Object
- Object
- IsoDoc::I18n
- Defined in:
- lib/isodoc/i18n.rb
Instance Method Summary collapse
Instance Method Details
#load_yaml1(lang, script) ⇒ Object
19 20 21 |
# File 'lib/isodoc/i18n.rb', line 19 def load_yaml1(lang, script) load_yaml2(yaml_lang(lang, script)) end |
#load_yaml2(str) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/isodoc/i18n.rb', line 23 def load_yaml2(str) f = File.join(File.dirname(__FILE__), "../isodoc-yaml/i18n-#{str}.yaml") File.exist?(f) or f = File.join(File.dirname(__FILE__), "../isodoc-yaml/i18n-en.yaml") YAML.load_file(f) end |
#yaml_lang(lang, script) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/isodoc/i18n.rb', line 10 def yaml_lang(lang, script) case lang when "en", "fr", "ru", "de", "es", "ar", "ja" lang when "zh" "#{lang}-#{script}" end end |