Class: IsoDoc::Plateau::I18n
- Inherits:
-
Jis::I18n
- Object
- Jis::I18n
- IsoDoc::Plateau::I18n
- Defined in:
- lib/isodoc/plateau/i18n.rb
Instance Method Summary collapse
-
#japanese_year(time) ⇒ Object
Numeric regnal year.
- #load_file(fname) ⇒ Object
- #load_yaml1(lang, script) ⇒ Object
Instance Method Details
#japanese_year(time) ⇒ Object
Numeric regnal year
18 19 20 21 22 23 |
# File 'lib/isodoc/plateau/i18n.rb', line 18 def japanese_year(time) era_yr = time.era_year.to_i "#{time.strftime('%JN')}#{era_yr}年" rescue StandardError time.year.to_s end |
#load_file(fname) ⇒ Object
7 8 9 10 |
# File 'lib/isodoc/plateau/i18n.rb', line 7 def load_file(fname) f = File.join(File.dirname(__FILE__), fname) File.exist?(f) ? YAML.load_file(f) : {} end |
#load_yaml1(lang, script) ⇒ Object
12 13 14 15 |
# File 'lib/isodoc/plateau/i18n.rb', line 12 def load_yaml1(lang, script) y = load_file("i18n-#{yaml_lang(lang, script)}.yaml") y.empty? ? load_file("i18n-en.yaml").merge(super) : super.deep_merge(y) end |