Sha256: 2376ef3614f4b8727c2b936164814948b1a51276d4c6cb017752ddc7f6501184

Contents?: true

Size: 1.53 KB

Versions: 32

Compression:

Stored size: 1.53 KB

Contents

require "yaml"

module Asciidoctor
  module Standoc
    module I18n
        def load_yaml(lang, script)
          if @i18nyaml then YAML.load_file(@i18nyaml)
          elsif lang == "en"
            YAML.load_file(File.join(File.dirname(__FILE__),
                                     "../../asciidoctor-yaml/i18n-en.yaml"))
          elsif lang == "fr"
            YAML.load_file(File.join(File.dirname(__FILE__),
                                     "../../asciidoctor-yaml/i18n-fr.yaml"))
          elsif lang == "zh" && script == "Hans"
            YAML.load_file(File.join(File.dirname(__FILE__),
                                     "../../asciidoctor-yaml/i18n-zh-Hans.yaml"))
          else
            YAML.load_file(File.join(File.dirname(__FILE__),
                                     "../../asciidoctor-yaml/i18n-en.yaml"))
          end
        end

        def i18n_init(lang, script)
          @lang = lang
          @script = script
          y = load_yaml(lang, script)
          @term_def_boilerplate = y["term_def_boilerplate"] || ""
          @no_terms_boilerplate = y["no_terms_boilerplate"] || ""
          @internal_terms_boilerplate = y["internal_terms_boilerplate"] || ""
          @norm_with_refs_pref = y["norm_with_refs_pref"] || ""
          @norm_empty_pref = y["norm_empty_pref"] || ""
          @external_terms_boilerplate = y["external_terms_boilerplate"] || ""
          @internal_external_terms_boilerplate =
            y["internal_external_terms_boilerplate"] || ""
          @labels = y
        end
      end
    end
  end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-standoc-1.4.4/lib/asciidoctor/standoc/i18n.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/metanorma-standoc-1.4.4/lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.4.4 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.4.3 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.4.2 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.4.1 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.4.0 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.29 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.28 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.27 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.26 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.25 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.24 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.23 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.22 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.21 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.20 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.19 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.18 lib/asciidoctor/standoc/i18n.rb
metanorma-standoc-1.3.17 lib/asciidoctor/standoc/i18n.rb