num2words 0.1.4 → 0.1.6

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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/Gemfile +0 -1
  4. data/README.md +85 -23
  5. data/config/locales/ar.yml +176 -17
  6. data/config/locales/be.yml +182 -15
  7. data/config/locales/bg.yml +183 -16
  8. data/config/locales/bn.yml +185 -12
  9. data/config/locales/cs.yml +180 -13
  10. data/config/locales/da.yml +182 -15
  11. data/config/locales/de.yml +181 -14
  12. data/config/locales/el.yml +183 -21
  13. data/config/locales/en.yml +145 -18
  14. data/config/locales/es.yml +180 -13
  15. data/config/locales/et.yml +185 -13
  16. data/config/locales/fa.yml +179 -12
  17. data/config/locales/fi.yml +180 -8
  18. data/config/locales/fr.yml +180 -13
  19. data/config/locales/gu.yml +182 -10
  20. data/config/locales/he.yml +182 -20
  21. data/config/locales/hi.yml +182 -15
  22. data/config/locales/hr.yml +181 -14
  23. data/config/locales/hu.yml +180 -13
  24. data/config/locales/id.yml +179 -12
  25. data/config/locales/it.yml +181 -14
  26. data/config/locales/ja.yml +188 -21
  27. data/config/locales/ru.yml +148 -15
  28. data/lib/num2words/config.rb +62 -0
  29. data/lib/num2words/converter.rb +115 -29
  30. data/lib/num2words/core_ext.rb +12 -0
  31. data/lib/num2words/locales/ar.rb +10 -2
  32. data/lib/num2words/locales/be.rb +10 -2
  33. data/lib/num2words/locales/bg.rb +10 -2
  34. data/lib/num2words/locales/bn.rb +10 -2
  35. data/lib/num2words/locales/cs.rb +10 -2
  36. data/lib/num2words/locales/da.rb +10 -2
  37. data/lib/num2words/locales/de.rb +10 -2
  38. data/lib/num2words/locales/el.rb +10 -2
  39. data/lib/num2words/locales/en.rb +4 -4
  40. data/lib/num2words/locales/es.rb +10 -2
  41. data/lib/num2words/locales/et.rb +10 -2
  42. data/lib/num2words/locales/fa.rb +10 -2
  43. data/lib/num2words/locales/fi.rb +10 -2
  44. data/lib/num2words/locales/fr.rb +10 -2
  45. data/lib/num2words/locales/gu.rb +10 -2
  46. data/lib/num2words/locales/he.rb +10 -2
  47. data/lib/num2words/locales/hi.rb +10 -2
  48. data/lib/num2words/locales/hr.rb +10 -2
  49. data/lib/num2words/locales/hu.rb +10 -2
  50. data/lib/num2words/locales/id.rb +10 -2
  51. data/lib/num2words/locales/it.rb +10 -2
  52. data/lib/num2words/locales/ja.rb +10 -2
  53. data/lib/num2words/locales/ru.rb +4 -4
  54. data/lib/num2words/version.rb +1 -1
  55. data/lib/num2words.rb +1 -0
  56. metadata +4 -3
@@ -10,14 +10,14 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :en)
11
11
  SCALES = I18n.t("num2words.scales", locale: :en)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.USD.name", locale: :en)
14
- MINOR_UNIT = I18n.t("num2words.currencies.USD.fractional.name", locale: :en)
15
-
16
13
  FRACTIONS = I18n.t("num2words.fractions", locale: :en)
17
14
  GRAMMAR = I18n.t("num2words.grammar", locale: :en)
18
15
 
19
16
  DATE = I18n.t("num2words.date", locale: :en)
20
- TEMPLATE = I18n.t("num2words.date.template", locale: :en)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :en)
18
+ TIME = I18n.t("num2words.time", locale: :en)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :en)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :en)
21
21
 
22
22
  ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :en)
23
23
  end
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :es)
11
11
  SCALES = I18n.t("num2words.scales", locale: :es)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.EUR.name", locale: :es)
14
- MINOR_UNIT = I18n.t("num2words.currencies.EUR.fractional.name", locale: :es)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :es)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :es)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :es)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :es)
18
+ TIME = I18n.t("num2words.time", locale: :es)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :es)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :es)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :es)
15
23
  end
16
24
 
17
25
  register :es, ES
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :et)
11
11
  SCALES = I18n.t("num2words.scales", locale: :et)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.EUR.name", locale: :et)
14
- MINOR_UNIT = I18n.t("num2words.currencies.EUR.fractional.name", locale: :et)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :et)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :et)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :et)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :et)
18
+ TIME = I18n.t("num2words.time", locale: :et)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :et)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :et)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :et)
15
23
  end
16
24
 
17
25
  register :et, ET
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :fa)
11
11
  SCALES = I18n.t("num2words.scales", locale: :fa)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.IRR.name", locale: :fa)
14
- MINOR_UNIT = I18n.t("num2words.currencies.IRR.fractional.name", locale: :fa)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :fa)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :fa)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :fa)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :fa)
18
+ TIME = I18n.t("num2words.time", locale: :fa)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :fa)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :fa)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :fa)
15
23
  end
16
24
 
17
25
  register :fa, FA
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :fi)
11
11
  SCALES = I18n.t("num2words.scales", locale: :fi)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.EUR.name", locale: :fi)
14
- MINOR_UNIT = I18n.t("num2words.currencies.EUR.fractional.name", locale: :fi)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :fi)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :fi)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :fi)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :fi)
18
+ TIME = I18n.t("num2words.time", locale: :fi)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :fi)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :fi)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :fi)
15
23
  end
16
24
 
17
25
  register :fi, FI
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :fr)
11
11
  SCALES = I18n.t("num2words.scales", locale: :fr)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.EUR.name", locale: :fr)
14
- MINOR_UNIT = I18n.t("num2words.currencies.EUR.fractional.name", locale: :fr)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :fr)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :fr)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :fr)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :fr)
18
+ TIME = I18n.t("num2words.time", locale: :fr)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :fr)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :fr)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :fr)
15
23
  end
16
24
 
17
25
  register :fr, FR
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :gu)
11
11
  SCALES = I18n.t("num2words.scales", locale: :gu)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.INR.name", locale: :gu)
14
- MINOR_UNIT = I18n.t("num2words.currencies.INR.fractional.name", locale: :gu)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :gu)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :gu)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :gu)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :gu)
18
+ TIME = I18n.t("num2words.time", locale: :gu)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :gu)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :gu)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :gu)
15
23
  end
16
24
 
17
25
  register :gu, GU
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :he)
11
11
  SCALES = I18n.t("num2words.scales", locale: :he)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.ILS.name", locale: :he)
14
- MINOR_UNIT = I18n.t("num2words.currencies.ILS.fractional.name", locale: :he)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :he)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :he)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :he)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :he)
18
+ TIME = I18n.t("num2words.time", locale: :he)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :he)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :he)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :he)
15
23
  end
16
24
 
17
25
  register :he, HE
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :hi)
11
11
  SCALES = I18n.t("num2words.scales", locale: :hi)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.INR.name", locale: :hi)
14
- MINOR_UNIT = I18n.t("num2words.currencies.INR.fractional.name", locale: :hi)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :hi)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :hi)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :hi)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :hi)
18
+ TIME = I18n.t("num2words.time", locale: :hi)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :hi)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :hi)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :hi)
15
23
  end
16
24
 
17
25
  register :hi, HI
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :hr)
11
11
  SCALES = I18n.t("num2words.scales", locale: :hr)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.EUR.name", locale: :hr)
14
- MINOR_UNIT = I18n.t("num2words.currencies.EUR.fractional.name", locale: :hr)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :hr)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :hr)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :hr)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :hr)
18
+ TIME = I18n.t("num2words.time", locale: :hr)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :hr)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :hr)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :hr)
15
23
  end
16
24
 
17
25
  register :hr, HR
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :hu)
11
11
  SCALES = I18n.t("num2words.scales", locale: :hu)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.HUF.name", locale: :hu)
14
- MINOR_UNIT = I18n.t("num2words.currencies.HUF.fractional.name", locale: :hu)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :hu)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :hu)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :hu)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :hu)
18
+ TIME = I18n.t("num2words.time", locale: :hu)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :hu)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :hu)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :hu)
15
23
  end
16
24
 
17
25
  register :hu, HU
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :id)
11
11
  SCALES = I18n.t("num2words.scales", locale: :id)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.IDR.name", locale: :id)
14
- MINOR_UNIT = I18n.t("num2words.currencies.IDR.fractional.name", locale: :id)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :id)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :id)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :id)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :id)
18
+ TIME = I18n.t("num2words.time", locale: :id)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :id)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :id)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :id)
15
23
  end
16
24
 
17
25
  register :id, ID
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :it)
11
11
  SCALES = I18n.t("num2words.scales", locale: :it)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.EUR.name", locale: :it)
14
- MINOR_UNIT = I18n.t("num2words.currencies.EUR.fractional.name", locale: :it)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :it)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :it)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :it)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :it)
18
+ TIME = I18n.t("num2words.time", locale: :it)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :it)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :it)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :it)
15
23
  end
16
24
 
17
25
  register :it, IT
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :ja)
11
11
  SCALES = I18n.t("num2words.scales", locale: :ja)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.JPY.name", locale: :ja)
14
- MINOR_UNIT = I18n.t("num2words.currencies.JPY.fractional.name", locale: :ja)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :ja)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :ja)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :ja)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :ja)
18
+ TIME = I18n.t("num2words.time", locale: :ja)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :ja)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :ja)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :ja)
15
23
  end
16
24
 
17
25
  register :ja, JA
@@ -10,14 +10,14 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :ru)
11
11
  SCALES = I18n.t("num2words.scales", locale: :ru)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.RUB.name", locale: :ru)
14
- MINOR_UNIT = I18n.t("num2words.currencies.RUB.fractional.name", locale: :ru)
15
-
16
13
  FRACTIONS = I18n.t("num2words.fractions", locale: :ru)
17
14
  GRAMMAR = I18n.t("num2words.grammar", locale: :ru)
18
15
 
19
16
  DATE = I18n.t("num2words.date", locale: :ru)
20
- TEMPLATE = I18n.t("num2words.date.template", locale: :ru)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :ru)
18
+ TIME = I18n.t("num2words.time", locale: :ru)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :ru)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :ru)
21
21
 
22
22
  ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :ru)
23
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Num2words
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.6"
5
5
  end
data/lib/num2words.rb CHANGED
@@ -5,6 +5,7 @@ require_relative "num2words/version"
5
5
  require_relative "num2words/converter"
6
6
  require_relative "num2words/core_ext"
7
7
  require_relative "num2words/locales"
8
+ require_relative "num2words/config"
8
9
 
9
10
  module Num2words
10
11
  def self.to_words(number, *args, **opts)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: num2words
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Fedotov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-21 00:00:00.000000000 Z
11
+ date: 2025-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -91,6 +91,7 @@ files:
91
91
  - config/locales/vi.yml
92
92
  - config/locales/zh.yml
93
93
  - lib/num2words.rb
94
+ - lib/num2words/config.rb
94
95
  - lib/num2words/converter.rb
95
96
  - lib/num2words/core_ext.rb
96
97
  - lib/num2words/i18n.rb
@@ -169,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
170
  - !ruby/object:Gem::Version
170
171
  version: '0'
171
172
  requirements: []
172
- rubygems_version: 3.1.2
173
+ rubygems_version: 3.1.6
173
174
  signing_key:
174
175
  specification_version: 4
175
176
  summary: Russian number-to-words with currency (руб/коп) and correct declensions