Class: IsoDoc::RelatonRenderI18n
- Inherits:
-
I18n
- Object
- I18n
- IsoDoc::RelatonRenderI18n
- Defined in:
- lib/isodoc/i18n.rb
Instance Method Summary collapse
-
#cleanup_entities(hash, is_xml: true) ⇒ Object
force bidi for all i18n strings in Arabic, because of the potential for script mixing.
- #load_yaml1(lang, script) ⇒ Object
- #load_yaml2(str) ⇒ Object
Instance Method Details
#cleanup_entities(hash, is_xml: true) ⇒ Object
force bidi for all i18n strings in Arabic, because of the potential for script mixing
25 26 27 28 29 30 31 |
# File 'lib/isodoc/i18n.rb', line 25 def cleanup_entities(hash, is_xml: true) ret = super if @lang == "ar" && /%/.match?(ret) ret = "؜#{ret}؜" end ret end |
#load_yaml1(lang, script) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/isodoc/i18n.rb', line 6 def load_yaml1(lang, script) case lang when "en", "fr", "ru", "de", "es", "ar" load_yaml2(lang) when "zh" if script == "Hans" then load_yaml2("zh-Hans") else load_yaml2("en") end else load_yaml2("en") end end |
#load_yaml2(str) ⇒ Object
18 19 20 21 |
# File 'lib/isodoc/i18n.rb', line 18 def load_yaml2(str) YAML.load_file(File.join(File.dirname(__FILE__), "../isodoc-yaml/i18n-#{str}.yaml")) end |