Sha256: 54e78a6d65d707a36823cb721ba2522b5833698cece409356f18f6637c159adb
Contents?: true
Size: 836 Bytes
Versions: 20
Compression:
Stored size: 836 Bytes
Contents
require "yaml" require "isodoc-i18n" module IsoDoc class RelatonRenderI18n < I18n def load_yaml1(lang, script) case lang when "en", "fr", "ru", "de", "es", "ar", "ja" load_yaml2(lang) when "zh" case script when "Hans", "Hant" then load_yaml2("zh-#{script}") else load_yaml2("zh-Hans") end else load_yaml2("en") end end def load_yaml2(str) YAML.load_file(File.join(File.dirname(__FILE__), "../isodoc-yaml/i18n-#{str}.yaml")) end # force bidi for all i18n strings in Arabic, # because of the potential for script mixing def cleanup_entities(hash, is_xml: true) ret = super if @lang == "ar" && ret.include?("%") ret = "؜#{ret}؜" end ret end end end
Version data entries
20 entries across 20 versions & 1 rubygems