relaton-render 0.3.5 → 0.3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba6bd04a097e0a57a1b55548d1775f54297d707271da779330c679e1a1e3fc8f
4
- data.tar.gz: 39115748cd3ffea7793a2d662c22c26a4219baa4969e42b048aec0bc7c8a157f
3
+ metadata.gz: 878e2dbeb1c5571bfc619872e1c195baa08095cea46dbf5ee26d67e1aad2185d
4
+ data.tar.gz: 17c6d2fd34334f23d4c2fe9e8dea4525ed15923b3574e189fdd4c1df3b0e357b
5
5
  SHA512:
6
- metadata.gz: ce06415c2964c88e26eea1db635bca0928c381e40f18f395a8a227ea848d65d0c025decba2df2141ff411e542d244724146834744024bd24b2b8e9e7a4eb0a51
7
- data.tar.gz: b0e94d253c820e8afb429ee8512de473c7a1a1f536ec6643efc7a7411bb46fba29ec104bcff7e764f4cd9cf2661023374521cf1fc5907b97ca9e564cf1e5bd52
6
+ metadata.gz: 541bd02b23d5b02fcc4369e19977de9abc4c40fe41f990bb2b6d23f5dec5dc05501ef40d2eb43da1c04083a8ff7cb71c9b7d059f5903172f6f457adc36ec3f37
7
+ data.tar.gz: 351b500e32b7a09d561f21591e675097477e7b2d7b08e20ccf3a6924c29b108de8e698e8430a95242c2a4c4a2bc5271ecc7da5c59d40f136a7cb50307fe7414f
data/README.adoc CHANGED
@@ -37,6 +37,7 @@ The parameters are:
37
37
  `sizetemplate`:: templates for rendering sizes
38
38
  `edition_ordinal`:: override formatting of edition with ordinal
39
39
  `date`:: default date format (from Twitter CLDR)
40
+ `i18nhash`:: Metanorma internationalisation hash
40
41
 
41
42
  == Configuration
42
43
 
@@ -4,7 +4,7 @@ and: و
4
4
  updated: محدث
5
5
  viewed: ينظر
6
6
  version: الإصدار
7
- date:
7
+ date_formats:
8
8
  month_year: yMMMM
9
9
  day_month_year: to_long_s
10
10
  date_time: to_long_s
@@ -4,7 +4,7 @@ and: und
4
4
  updated: aktualisiert
5
5
  viewed: angesehen
6
6
  version: Version
7
- date:
7
+ date_formats:
8
8
  month_year: yMMMM
9
9
  day_month_year: to_long_s
10
10
  date_time: to_long_s
@@ -4,7 +4,7 @@ and: and
4
4
  updated: updated
5
5
  viewed: viewed
6
6
  version: version
7
- date:
7
+ date_formats:
8
8
  month_year: yMMMM
9
9
  day_month_year: to_long_s
10
10
  date_time: to_long_s
@@ -4,7 +4,7 @@ and: y
4
4
  updated: actualizado
5
5
  viewed: visto
6
6
  version: versión
7
- date:
7
+ date_formats:
8
8
  month_year: yMMMM
9
9
  day_month_year: to_long_s
10
10
  date_time: to_long_s
@@ -4,7 +4,7 @@ and: et
4
4
  updated: mise à jour
5
5
  viewed: vu
6
6
  version: version
7
- date:
7
+ date_formats:
8
8
  month_year: yMMMM
9
9
  day_month_year: to_long_s
10
10
  date_time: to_long_s
@@ -4,7 +4,7 @@ and: и
4
4
  updated: обновлен
5
5
  viewed: просмотрено
6
6
  version: версия
7
- date:
7
+ date_formats:
8
8
  month_year: yMMMM
9
9
  day_month_year: to_long_s
10
10
  date_time: to_long_s
@@ -4,7 +4,7 @@ and: 和
4
4
  updated: 更新
5
5
  viewed: 看过
6
6
  version: 版本
7
- date:
7
+ date_formats:
8
8
  month_year: yMMMM
9
9
  day_month_year: to_long_s
10
10
  date_time: to_long_s
@@ -110,7 +110,7 @@ module Relaton
110
110
  end
111
111
  ruleset == "Digit" and return num.to_s
112
112
  ed = HTMLEntities.new.decode(@r.i18n.edition)
113
- @r.i18n.inflect_ordinal(num, @r.i18n.inflection&.dig(ed) || {},
113
+ @r.i18n.inflect_ordinal(num, @r.i18n.get["inflection"]&.dig(ed) || {},
114
114
  ruleset)
115
115
  end
116
116
 
@@ -19,7 +19,6 @@ module Relaton
19
19
  root_initalize(options)
20
20
  render_initialize(options)
21
21
  @parse ||= options["parse"]
22
- @i18n ||= options["i18n"]
23
22
  end
24
23
 
25
24
  def read_config
@@ -52,10 +51,11 @@ module Relaton
52
51
  def i18n_initialize(opt)
53
52
  @lang = opt["language"]
54
53
  @script = opt["script"]
55
- @i18n = i18n_klass(opt["language"], opt["script"])
54
+ @i18n = opt["i18n"] ||
55
+ i18n_klass(opt["language"], opt["script"], opt["i18nhash"])
56
56
  @edition_ordinal = opt["edition_ordinal"] || @i18n.edition_ordinal
57
57
  @edition = opt["edition"] || @i18n.edition
58
- @date = opt["date"] || @i18n.date
58
+ @date = opt["date"] || @i18n.date_formats
59
59
  end
60
60
 
61
61
  def render_initialize(opt)
@@ -91,8 +91,8 @@ module Relaton
91
91
  "{{creatornames}}. {{title}}. {{date}}."
92
92
  end
93
93
 
94
- def i18n_klass(lang = "en", script = "Latn")
95
- ::IsoDoc::RelatonRenderI18n.new(lang, script)
94
+ def i18n_klass(lang = "en", script = "Latn", i18nhash = nil)
95
+ ::IsoDoc::RelatonRenderI18n.new(lang, script, i18nhash: i18nhash)
96
96
  end
97
97
 
98
98
  def render(bib, embedded: false)
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Render
3
- VERSION = "0.3.5".freeze
3
+ VERSION = "0.3.6.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-render
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-02 00:00:00.000000000 Z
11
+ date: 2022-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler