relaton-render 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67568cad7210dff0b205836fc4383d409b5f8b38b49a776a8ed67e2507c8e145
4
- data.tar.gz: fafb18d828ea75cdc786cce531da42c972b2472d3911fdfe92b5428988fcce04
3
+ metadata.gz: 51ae7431472a2a411d6fbb2e0d68e7a8b32c647cf839886c347e34000576a11c
4
+ data.tar.gz: 5ede0d93ad108c2add767f4b9a5cec9b483ee9a1b6dd2db60ef51ee2959e65ab
5
5
  SHA512:
6
- metadata.gz: 759d9da2be9ac7ce34abd03e9458c7ccec8075930061adc6002ebae138cde6f35cb8a6eb714a69bd22d8e134a7c6f08bda1b3f8e722e418ada17fd416e33a7e1
7
- data.tar.gz: 44040060e55e3396c257838f7cf73a6ba85a4b2da203c4d1fd676fd04222051f8e4030ec3f5bd3a2c2093d671d56f13529d16c929ea16861d298b2f7d597ff8a
6
+ metadata.gz: 0a2c1ff06584f6dddaedd7fab2d58467f3f4e54330107ff300529f26094f67331d09a19838743185af859c9d1deadbe4219ecec1e562f23bd320d87d4359bc1d
7
+ data.tar.gz: 2da0c615b6cb5a610d9d4d14c892d22131eb3317595b5b2e131baf7d8f985cb0a8fc76a66f22ab550fc83b37005d9b29c6817ded7bc0b0b50ef3519a1c6ea769
@@ -10,4 +10,4 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- uses: relaton/support/.github/workflows/rake.yml@master
13
+ uses: relaton/support/.github/workflows/rake.yml@main
@@ -17,7 +17,7 @@ on:
17
17
 
18
18
  jobs:
19
19
  release:
20
- uses: relaton/support/.github/workflows/release.yml@master
20
+ uses: relaton/support/.github/workflows/release.yml@main
21
21
  with:
22
22
  next_version: ${{ github.event.inputs.next_version }}
23
23
  secrets:
data/Gemfile CHANGED
@@ -6,3 +6,6 @@ source "https://rubygems.org"
6
6
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
7
7
 
8
8
  gemspec
9
+
10
+ eval_gemfile("Gemfile.devel") rescue nil
11
+
@@ -14,7 +14,7 @@ date_formats:
14
14
  date_time: to_long_s
15
15
  ordinal_keys: []
16
16
  OrdinalRules: digits-ordinal
17
- edition_ordinal: "الطبعة؜ %Ordinal"
17
+ edition_ordinal: "الطبعة؜ {{ var1 | ordinal_num: 'edition', '' }}"
18
18
  edition: الطبعة؜ ؜
19
19
  draft: "مشروع؜ %؜"
20
20
  editor:
@@ -46,5 +46,6 @@ q-open:
46
46
  q-close:
47
47
  inflection:
48
48
  الطبعة؜:
49
- gender: f
49
+ grammar:
50
+ gender: f
50
51
 
@@ -13,9 +13,9 @@ date_formats:
13
13
  day_month_year: to_long_s
14
14
  date_time: to_long_s
15
15
  draft: "Entwurf %"
16
- edition_ordinal: "% Aufl."
16
+ edition_ordinal: "{{ var1 }} Ausg."
17
17
  ordinal_keys: []
18
- edition: Auflage
18
+ edition: Ausgabe
19
19
  editor:
20
20
  sg: Hrsg.
21
21
  pl: Hrsg.
@@ -44,6 +44,7 @@ size:
44
44
  sg: "% Nr."
45
45
  pl: "% Nr."
46
46
  inflection:
47
- Auflage:
48
- gender: f
47
+ Ausgabe:
48
+ grammar:
49
+ gender: f
49
50
 
@@ -15,7 +15,7 @@ date_formats:
15
15
  ordinal_keys: []
16
16
  OrdinalRules: digits-ordinal
17
17
  edition: edition
18
- edition_ordinal: "%Ordinal edition"
18
+ edition_ordinal: "{{ var1 | ordinal_num: '', '' }} edition"
19
19
  draft: "draft %"
20
20
  editor:
21
21
  sg: ed.
@@ -16,7 +16,7 @@ ordinal_keys: [gender]
16
16
  OrdinalRules:
17
17
  m: digits-ordinal-masculine
18
18
  f: digits-ordinal-feminine
19
- edition_ordinal: "%Ordinal ed."
19
+ edition_ordinal: "{{ var1 | ordinal_num: 'edition', '' }} ed."
20
20
  edition: edición
21
21
  draft: "borrador %"
22
22
  editor:
@@ -49,5 +49,6 @@ issue:
49
49
 
50
50
  inflection:
51
51
  edición:
52
- gender: f
52
+ grammar:
53
+ gender: f
53
54
 
@@ -18,7 +18,7 @@ OrdinalRules:
18
18
  f.sg: digits-ordinal-feminine
19
19
  m.pl: digits-ordinal-masculine-plural
20
20
  f.pl: digits-ordinal-feminine-plural
21
- edition_ordinal: "%Ordinal édition"
21
+ edition_ordinal: "{{ var1 | ordinal_num: 'edition', '' }} édition"
22
22
  edition: édition
23
23
  draft: "brouillon %"
24
24
  editor:
@@ -50,5 +50,6 @@ size:
50
50
  pl: "% nᵒˢ"
51
51
  inflection:
52
52
  édition:
53
- gender: f
53
+ grammar:
54
+ gender: f
54
55
 
@@ -15,7 +15,7 @@ date_formats:
15
15
  ordinal_keys: []
16
16
  OrdinalRules: digits-ordinal
17
17
  edition: 版
18
- edition_ordinal: "%Ordinal edition"
18
+ edition_ordinal: "{{ var1 | ordinal_num: 'edition', '' }} edition"
19
19
  draft: "下書き %"
20
20
  editor:
21
21
  sg: 編
@@ -20,7 +20,7 @@ SpelloutRules:
20
20
  m.pl: spellout-ordinal-plural
21
21
  f.pl: spellout-ordinal-plural
22
22
  n.pl: spellout-ordinal-plural
23
- edition_ordinal: "%Spellout издание"
23
+ edition_ordinal: "{{ var1 | ordinal_word: 'edition', '' }} издание"
24
24
  edition: издание
25
25
  draft: "проект %"
26
26
  editor:
@@ -53,5 +53,6 @@ size:
53
53
  pl: "% шт."
54
54
  inflection:
55
55
  издание:
56
- gender: n
56
+ grammar:
57
+ gender: n
57
58
 
@@ -14,7 +14,7 @@ date_formats:
14
14
  date_time: to_long_s
15
15
  ordinal_keys: []
16
16
  OrdinalRules: digits-ordinal
17
- edition_ordinal: "第%Ordinal版"
17
+ edition_ordinal: "第{{ var1 | ordinal_num: '', '' }}版"
18
18
  edition: 版
19
19
  draft: "草案%"
20
20
  editor:
@@ -14,7 +14,7 @@ date_formats:
14
14
  date_time: to_long_s
15
15
  ordinal_keys: []
16
16
  OrdinalRules: digits-ordinal
17
- edition_ordinal: "第%Ordinal版"
17
+ edition_ordinal: "第{{ var1 | ordinal_num: '', '' }}版"
18
18
  edition: 版
19
19
  draft: "草案%"
20
20
  editor:
@@ -115,22 +115,8 @@ module Relaton
115
115
  end
116
116
 
117
117
  def editionformat(edn, num)
118
- return edn unless num || /^\d+$/.match?(edn)
119
-
120
- ret = edition_translate1(num || edn.to_i)
121
- @r.edition_ordinal.sub(/%(Spellout|Ordinal)?/, ret)
122
- end
123
-
124
- def edition_translate1(num)
125
- ruleset = case @r.i18n.edition_ordinal
126
- when /%Spellout/ then "SpelloutRules"
127
- when /%Ordinal/ then "OrdinalRules"
128
- else "Digit"
129
- end
130
- ruleset == "Digit" and return num.to_s
131
- ed = HTMLEntities.new.decode(@r.i18n.edition)
132
- @r.i18n.inflect_ordinal(num, @r.i18n.get["inflection"]&.dig(ed) || {},
133
- ruleset)
118
+ num || /^\d+$/.match?(edn) or return edn
119
+ @r.i18n.populate("edition_ordinal", { "var1" => num || edn.to_i })
134
120
  end
135
121
 
136
122
  def draftformat(num, _hash)
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Render
3
- VERSION = "0.6.2".freeze
3
+ VERSION = "0.7.0".freeze
4
4
  end
5
5
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
29
29
  spec.add_development_dependency "simplecov"
30
30
 
31
- spec.add_dependency "isodoc-i18n", "~> 1.2.0"
31
+ spec.add_dependency "isodoc-i18n", "~> 1.2.1"
32
32
  spec.add_dependency "liquid", "~> 5"
33
33
  spec.add_dependency "nokogiri"
34
34
  spec.add_dependency "relaton-bib", ">= 1.13.0"
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.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-29 00:00:00.000000000 Z
11
+ date: 2024-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.2.0
103
+ version: 1.2.1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.2.0
110
+ version: 1.2.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: liquid
113
113
  requirement: !ruby/object:Gem::Requirement