num2words 0.1.5 → 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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -1
  3. data/config/locales/ar.yml +176 -17
  4. data/config/locales/be.yml +182 -15
  5. data/config/locales/bg.yml +183 -16
  6. data/config/locales/bn.yml +185 -12
  7. data/config/locales/cs.yml +180 -13
  8. data/config/locales/da.yml +182 -15
  9. data/config/locales/de.yml +181 -14
  10. data/config/locales/el.yml +183 -21
  11. data/config/locales/en.yml +129 -12
  12. data/config/locales/es.yml +180 -13
  13. data/config/locales/et.yml +185 -13
  14. data/config/locales/fa.yml +179 -12
  15. data/config/locales/fi.yml +180 -8
  16. data/config/locales/fr.yml +180 -13
  17. data/config/locales/gu.yml +182 -10
  18. data/config/locales/he.yml +182 -20
  19. data/config/locales/hi.yml +182 -15
  20. data/config/locales/hr.yml +181 -14
  21. data/config/locales/hu.yml +180 -13
  22. data/config/locales/id.yml +179 -12
  23. data/config/locales/it.yml +181 -14
  24. data/config/locales/ja.yml +188 -21
  25. data/config/locales/ru.yml +131 -9
  26. data/lib/num2words/config.rb +62 -0
  27. data/lib/num2words/converter.rb +44 -36
  28. data/lib/num2words/locales/ar.rb +10 -2
  29. data/lib/num2words/locales/be.rb +10 -2
  30. data/lib/num2words/locales/bg.rb +10 -2
  31. data/lib/num2words/locales/bn.rb +10 -2
  32. data/lib/num2words/locales/cs.rb +10 -2
  33. data/lib/num2words/locales/da.rb +10 -2
  34. data/lib/num2words/locales/de.rb +10 -2
  35. data/lib/num2words/locales/el.rb +10 -2
  36. data/lib/num2words/locales/en.rb +0 -3
  37. data/lib/num2words/locales/es.rb +10 -2
  38. data/lib/num2words/locales/et.rb +10 -2
  39. data/lib/num2words/locales/fa.rb +10 -2
  40. data/lib/num2words/locales/fi.rb +10 -2
  41. data/lib/num2words/locales/fr.rb +10 -2
  42. data/lib/num2words/locales/gu.rb +10 -2
  43. data/lib/num2words/locales/he.rb +10 -2
  44. data/lib/num2words/locales/hi.rb +10 -2
  45. data/lib/num2words/locales/hr.rb +10 -2
  46. data/lib/num2words/locales/hu.rb +10 -2
  47. data/lib/num2words/locales/id.rb +10 -2
  48. data/lib/num2words/locales/it.rb +10 -2
  49. data/lib/num2words/locales/ja.rb +10 -2
  50. data/lib/num2words/locales/ru.rb +0 -3
  51. data/lib/num2words/version.rb +1 -1
  52. data/lib/num2words.rb +1 -0
  53. metadata +4 -3
@@ -13,13 +13,6 @@ ru:
13
13
  - ["миллиард", "миллиарда", "миллиардов"]
14
14
  - ["триллион", "триллиона", "триллионов"]
15
15
 
16
- currencies:
17
- RUB:
18
- name: ["рубль", "рубля", "рублей"]
19
- fractional:
20
- name: ["копейка", "копейки", "копеек"]
21
- feminine: true
22
-
23
16
  grammar:
24
17
  minus: "минус"
25
18
  conjunction: "целых"
@@ -63,8 +56,8 @@ ru:
63
56
  default: "%{day} %{month} %{year} года"
64
57
  nominative: "%{day} %{month} %{year} год"
65
58
  months:
66
- default: [ "января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря" ]
67
- nominative: [ "января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря" ]
59
+ default: ["января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"]
60
+ nominative: ["января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"]
68
61
  time:
69
62
  template:
70
63
  hours_only: "%{hours}"
@@ -74,3 +67,132 @@ ru:
74
67
  hour: ["час", "часа", "часов"]
75
68
  minute: ["минута", "минуты", "минут"]
76
69
  second: ["секунда", "секунды", "секунд"]
70
+
71
+ warnings:
72
+ currency_not_available: "Валюта %{currency} недоступна для локали %{lang}, используется текущая."
73
+
74
+ currencies:
75
+ RUB:
76
+ major_unit: ["рубль", "рубля", "рублей"]
77
+ minor_unit: ["копейка", "копейки", "копеек"]
78
+ symbol: "₽"
79
+ USD:
80
+ major_unit: ["доллар", "доллара", "долларов"]
81
+ minor_unit: ["цент", "цента", "центов"]
82
+ symbol: "$"
83
+ EUR:
84
+ major_unit: ["евро", "евро", "евро"]
85
+ minor_unit: ["цент", "цента", "центов"]
86
+ symbol: "€"
87
+ GBP:
88
+ major_unit: ["фунт", "фунта", "фунтов"]
89
+ minor_unit: ["пенс", "пенса", "пенсов"]
90
+ symbol: "£"
91
+ CNY:
92
+ major_unit: ["юань", "юаня", "юаней"]
93
+ minor_unit: ["фэнь", "фэня", "фэней"]
94
+ symbol: "¥"
95
+ JPY:
96
+ major_unit: ["иена", "иены", "иен"]
97
+ minor_unit: ["сэн", "сэн", "сэн"]
98
+ symbol: "¥"
99
+ KRW:
100
+ major_unit: ["вона", "воны", "вон"]
101
+ minor_unit: ["чон", "чона", "чон"]
102
+ symbol: "₩"
103
+ TRY:
104
+ major_unit: ["лира", "лиры", "лир"]
105
+ minor_unit: ["куруш", "куруша", "курушей"]
106
+ symbol: "₺"
107
+ PLN:
108
+ major_unit: ["злотый", "злотых", "злотых"]
109
+ minor_unit: ["грош", "гроша", "грошей"]
110
+ symbol: "zł"
111
+ UAH:
112
+ major_unit: ["гривна", "гривны", "гривен"]
113
+ minor_unit: ["копейка", "копейки", "копеек"]
114
+ symbol: "₴"
115
+ CZK:
116
+ major_unit: ["крона", "кроны", "крон"]
117
+ minor_unit: ["галирж", "галиржа", "галиржей"]
118
+ symbol: "Kč"
119
+ RON:
120
+ major_unit: ["лей", "лея", "леев"]
121
+ minor_unit: ["бан", "бана", "банов"]
122
+ symbol: "lei"
123
+ BGN:
124
+ major_unit: ["лев", "лева", "левов"]
125
+ minor_unit: ["стотинка", "стотинки", "стотинок"]
126
+ symbol: "лв"
127
+ BYN:
128
+ major_unit: ["белорусский рубль", "белорусских рубля", "белорусских рублей"]
129
+ minor_unit: ["копейка", "копейки", "копеек"]
130
+ symbol: "Br"
131
+ KZT:
132
+ major_unit: ["тенге", "тенге", "тенге"]
133
+ minor_unit: ["тиын", "тиына", "тиынов"]
134
+ symbol: "₸"
135
+ ILS:
136
+ major_unit: ["шекель", "шекеля", "шекелей"]
137
+ minor_unit: ["агора", "агоры", "агорот"]
138
+ symbol: "₪"
139
+ SEK:
140
+ major_unit: ["крона", "кроны", "крон"]
141
+ minor_unit: ["эре", "эре", "эре"]
142
+ symbol: "kr"
143
+ NOK:
144
+ major_unit: ["крона", "кроны", "крон"]
145
+ minor_unit: ["эре", "эре", "эре"]
146
+ symbol: "kr"
147
+ DKK:
148
+ major_unit: ["крона", "кроны", "крон"]
149
+ minor_unit: ["эре", "эре", "эре"]
150
+ symbol: "kr"
151
+ HUF:
152
+ major_unit: ["форинт", "форинта", "форинтов"]
153
+ minor_unit: ["филлер", "филлера", "филлеров"]
154
+ symbol: "Ft"
155
+ SAR:
156
+ major_unit: ["риал", "риала", "риалов"]
157
+ minor_unit: ["халяла", "халялы", "халялов"]
158
+ symbol: "﷼"
159
+ INR:
160
+ major_unit: ["рупия", "рупии", "рупий"]
161
+ minor_unit: ["пайса", "пайсы", "пайс"]
162
+ symbol: "₹"
163
+ THB:
164
+ major_unit: ["бат", "бата", "батов"]
165
+ minor_unit: ["сатанг", "сатанга", "сатангов"]
166
+ symbol: "฿"
167
+ VND:
168
+ major_unit: ["донг", "донга", "донгов"]
169
+ minor_unit: ["су", "су", "су"]
170
+ symbol: "₫"
171
+ IDR:
172
+ major_unit: ["рупия", "рупии", "рупий"]
173
+ minor_unit: ["сена", "сены", "сенов"]
174
+ symbol: "Rp"
175
+ IRR:
176
+ major_unit: ["риал", "риала", "риалов"]
177
+ minor_unit: ["динам", "динама", "динамов"]
178
+ symbol: "﷼"
179
+ RSD:
180
+ major_unit: ["динар", "динара", "динаров"]
181
+ minor_unit: ["пара", "пары", "пар"]
182
+ symbol: "дин"
183
+ MYR:
184
+ major_unit: ["ринггит", "ринггита", "ринггитов"]
185
+ minor_unit: ["сен", "сена", "сенов"]
186
+ symbol: "RM"
187
+ BDT:
188
+ major_unit: ["така", "таки", "так"]
189
+ minor_unit: ["пойша", "пойши", "пойш"]
190
+ symbol: "৳"
191
+ PKR:
192
+ major_unit: ["рупия", "рупии", "рупий"]
193
+ minor_unit: ["пайса", "пайсы", "пайс"]
194
+ symbol: "₨"
195
+ KES:
196
+ major_unit: ["шиллинг", "шиллинга", "шиллингов"]
197
+ minor_unit: ["цент", "цента", "центов"]
198
+ symbol: "Sh"
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Num2words
4
+ class Config
5
+ attr_accessor :currency_warnings
6
+
7
+ def initialize
8
+ reset!
9
+ end
10
+
11
+ def default_currency(locale = nil, currency = nil)
12
+ if currency
13
+ currency = currency.to_s.upcase.to_sym
14
+ available = available_currencies(locale)
15
+
16
+ if available.include?(currency)
17
+ locale ? @local_currency[locale] = currency : @global_currency = currency
18
+ elsif currency_warnings
19
+ warn I18n.t("num2words.warnings.currency_not_available", lang: locale, currency: currency, locale: locale)
20
+ end
21
+ end
22
+
23
+ locale ? (@local_currency[locale] || available_currencies(locale).first || @global_currency) : @global_currency
24
+ end
25
+
26
+ def available_currencies(locale = I18n.locale)
27
+ I18n.t("num2words.currencies", locale: locale).keys.map(&:to_sym)
28
+ end
29
+
30
+ def reset!(locale = nil)
31
+ return @local_currency.delete(locale) if locale
32
+
33
+ @global_currency = available_currencies.first
34
+ @local_currency = {}
35
+ @currency_warnings = true
36
+ end
37
+ end
38
+
39
+ def self.config
40
+ @config ||= Config.new
41
+ end
42
+
43
+ def self.reset!
44
+ config.reset!(locale)
45
+ end
46
+
47
+ def self.default_currency(locale = nil, currency = nil)
48
+ config.default_currency(locale, currency)
49
+ end
50
+
51
+ def self.available_currencies(locale = I18n.locale)
52
+ config.available_currencies(locale)
53
+ end
54
+
55
+ def self.currency_warnings
56
+ config.currency_warnings
57
+ end
58
+
59
+ def self.currency_warnings=(value)
60
+ config.currency_warnings = value
61
+ end
62
+ end
@@ -7,13 +7,13 @@ module Num2words
7
7
  class Converter
8
8
  class << self
9
9
  def to_words(number, *args, **opts)
10
- locale = args[0].is_a?(Symbol) ? args[0] : opts[:locale] || I18n.default_locale
11
- type_only = args[1].is_a?(Symbol) ? args[1] : opts[:only]
12
- type_short = args[2].is_a?(TrueClass) || args[2].is_a?(FalseClass) ? args[2] : opts[:short] || false
10
+ locale = args[0].is_a?(Symbol) ? args[0] : opts[:locale] || I18n.default_locale
11
+ type_only = args[1].is_a?(Symbol) ? args[1] : opts[:only]
12
+ type_short = args[2].is_a?(TrueClass) || args[2].is_a?(FalseClass) ? args[2] : opts[:short] || false
13
13
 
14
- feminine = opts[:feminine] || false
15
- style = opts[:style] || :fraction
16
- word_case = opts[:word_case] || :default
14
+ feminine = opts[:feminine] || false
15
+ style = opts[:style] || :fraction
16
+ word_case = opts[:word_case] || :default
17
17
  date_format = opts[:format] || :default
18
18
 
19
19
  locale_data = Locales[locale]
@@ -33,22 +33,31 @@ module Num2words
33
33
  end
34
34
 
35
35
  def to_currency(amount, *args, **opts)
36
- locale = args.first.is_a?(Symbol) ? args.first : opts[:locale] || I18n.default_locale
37
- word_case = opts[:word_case] || :downcase
38
- locale_data = Locales[locale]
36
+ locale = args.first.is_a?(Symbol) ? args.first : opts[:locale] || I18n.default_locale
37
+ word_case = opts[:word_case] || :downcase
38
+ currency = (opts[:code] || Num2words.default_currency(locale)).to_s.upcase.to_sym
39
+
40
+ unless Num2words.available_currencies(locale).include?(currency)
41
+ warn I18n.t("num2words.warnings.currency_not_available",
42
+ currency: currency, locale: locale) if Num2words.currency_warnings
43
+ currency = Num2words.default_currency(locale)
44
+ end
39
45
 
40
- major_str, minor_str = sprintf('%.2f', amount).split('.')
41
- major_value = major_str.to_i
42
- minor_value = minor_str.to_i
46
+ currency_data = I18n.t("num2words.currencies.#{currency}", locale: locale) or
47
+ raise ArgumentError, "Currency #{currency} not defined in locale #{locale}"
43
48
 
44
- major_words = to_words(major_value, locale: locale)
45
- major_name = pluralize(major_value, *locale_data::MAJOR_UNIT)
49
+ major_value, minor_value = sprintf('%.2f', amount.abs).split('.').map(&:to_i)
46
50
 
47
- minor_words = to_words(minor_value, locale: locale, feminine: true)
48
- minor_name = pluralize(minor_value, *locale_data::MINOR_UNIT)
51
+ parts = [
52
+ to_words(major_value, locale: locale),
53
+ pluralize(major_value, *currency_data[:major_unit]),
54
+ to_words(minor_value, locale: locale, feminine: true),
55
+ pluralize(minor_value, *currency_data[:minor_unit])
56
+ ]
49
57
 
50
- result = [major_words, major_name, minor_words, minor_name].join(" ")
51
- apply_case(result, word_case)
58
+ parts.unshift(Locales[locale]::GRAMMAR[:minus] || "minus") if amount.negative?
59
+
60
+ apply_case(parts.join(" ").strip, word_case)
52
61
  end
53
62
 
54
63
  private
@@ -86,10 +95,10 @@ module Num2words
86
95
  end
87
96
 
88
97
  def to_words_fractional(number, locale, feminine, locale_data, style: :fraction)
89
- minus_word = locale_data::GRAMMAR[:minus] || "minus"
98
+ minus_word = locale_data::GRAMMAR[:minus] || "minus"
90
99
  conjunction_word = locale_data::GRAMMAR[:conjunction] || "and"
91
100
  default_fraction = locale_data::GRAMMAR[:default_fraction] || "parts"
92
- fractions_data = locale_data::FRACTIONS || {}
101
+ fractions_data = locale_data::FRACTIONS || {}
93
102
 
94
103
  sign_word = number.negative? ? minus_word : ""
95
104
 
@@ -99,7 +108,7 @@ module Num2words
99
108
  return to_words_integer(integer_value, locale, feminine, locale_data) if fraction_string.to_i.zero?
100
109
 
101
110
  fraction_string = fraction_string.sub(/0+\z/, "")
102
- numerator = fraction_string.to_i
111
+ numerator = fraction_string.to_i
103
112
  denominator = 10 ** fraction_string.length
104
113
 
105
114
  integer_words = to_words_integer(integer_value, locale, feminine, locale_data)
@@ -150,9 +159,9 @@ module Num2words
150
159
  raise ArgumentError, "Months not found for locale #{locale}" unless months
151
160
  raise ArgumentError, "Template not found for locale #{locale}" unless template
152
161
 
153
- day_words = to_words_ordinal(day, locale, format, locale_data, gender: :neuter)
162
+ day_words = to_words_ordinal(day, locale, format, locale_data, gender: :neuter)
154
163
  month_words = months[month - 1]
155
- year_words = to_words_ordinal(year, locale, format, locale_data)
164
+ year_words = to_words_ordinal(year, locale, format, locale_data)
156
165
 
157
166
  template % { day: day_words, month: month_words, year: year_words }
158
167
  end
@@ -168,9 +177,9 @@ module Num2words
168
177
 
169
178
  if value > 31
170
179
  thousands = (value / 100) * 100
171
- last_two = value % 100
180
+ last_two = value % 100
172
181
 
173
- base_year = to_words_integer(thousands, locale, false, locale_data)
182
+ base_year = to_words_integer(thousands, locale, false, locale_data)
174
183
  last_ordinal = gender_data[last_two - 1] || to_words_integer(last_two, locale, false, locale_data)
175
184
  last_ordinal = to_words_integer(last_two, locale, false, locale_data) if locale == :en
176
185
 
@@ -185,7 +194,7 @@ module Num2words
185
194
 
186
195
  return time.strftime("%H:%M") if format == :short
187
196
 
188
- words = locale_data::TIME[:words]
197
+ words = locale_data::TIME[:words]
189
198
  template = locale_data::TIME_TEMPLATE
190
199
 
191
200
  hours = [
@@ -219,7 +228,6 @@ module Num2words
219
228
  end
220
229
  end
221
230
 
222
-
223
231
  def to_words_datetime(datetime, locale, locale_data, format: :default, only: nil, short: false)
224
232
  datetime = DateTime.parse(datetime) if datetime.is_a?(String)
225
233
 
@@ -250,19 +258,19 @@ module Num2words
250
258
 
251
259
  def detect_type(value)
252
260
  case value
253
- when Integer then :integer
254
- when Float then :float
255
- when Date then :date
256
- when Time then :time
257
- when DateTime then :datetime
261
+ when Integer then :integer
262
+ when Float then :float
263
+ when Date then :date
264
+ when Time then :time
265
+ when DateTime then :datetime
258
266
  when String
259
267
  return :integer if value.match?(/\A-?\d+\z/)
260
- return :float if value.match?(/\A-?\d+\.\d+\z/)
261
- return :time if value.match?(/\A\d{1,2}:\d{2}(:\d{2})?\z/)
268
+ return :float if value.match?(/\A-?\d+\.\d+\z/)
269
+ return :time if value.match?(/\A\d{1,2}:\d{2}(:\d{2})?\z/)
262
270
 
263
271
  # Форматы даты
264
- return :date if value.match?(/\A\d{1,2}[.\-]\d{1,2}[.\-]\d{2,4}\z/)
265
- return :date if value.match?(/\A\d{4}-\d{2}-\d{2}\z/)
272
+ return :date if value.match?(/\A\d{1,2}[.\-]\d{1,2}[.\-]\d{2,4}\z/)
273
+ return :date if value.match?(/\A\d{4}-\d{2}-\d{2}\z/)
266
274
  return :datetime if value.match?(/\A\d{1,2}[.\-]\d{1,2}[.\-]\d{2,4}\s+\d{1,2}:\d{2}(:\d{2})?\z/)
267
275
  return :datetime if value.match?(/\A\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}(:\d{2})?([.,]\d+)?(Z|[+\-]\d{2}:?\d{2})?\z/)
268
276
 
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :ar)
11
11
  SCALES = I18n.t("num2words.scales", locale: :ar)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.SAR.name", locale: :ar)
14
- MINOR_UNIT = I18n.t("num2words.currencies.SAR.fractional.name", locale: :ar)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :ar)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :ar)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :ar)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :ar)
18
+ TIME = I18n.t("num2words.time", locale: :ar)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :ar)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :ar)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :ar)
15
23
  end
16
24
 
17
25
  register :ar, AR
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :be)
11
11
  SCALES = I18n.t("num2words.scales", locale: :be)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.BYN.name", locale: :be)
14
- MINOR_UNIT = I18n.t("num2words.currencies.BYN.fractional.name", locale: :be)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :be)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :be)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :be)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :be)
18
+ TIME = I18n.t("num2words.time", locale: :be)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :be)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :be)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :be)
15
23
  end
16
24
 
17
25
  register :be, BE
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :bg)
11
11
  SCALES = I18n.t("num2words.scales", locale: :bg)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.BGN.name", locale: :bg)
14
- MINOR_UNIT = I18n.t("num2words.currencies.BGN.fractional.name", locale: :bg)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :bg)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :bg)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :bg)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :bg)
18
+ TIME = I18n.t("num2words.time", locale: :bg)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :bg)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :bg)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :bg)
15
23
  end
16
24
 
17
25
  register :bg, BG
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :bn)
11
11
  SCALES = I18n.t("num2words.scales", locale: :bn)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.BDT.name", locale: :bn)
14
- MINOR_UNIT = I18n.t("num2words.currencies.BDT.fractional.name", locale: :bn)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :bn)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :bn)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :bn)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :bn)
18
+ TIME = I18n.t("num2words.time", locale: :bn)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :bn)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :bn)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :bn)
15
23
  end
16
24
 
17
25
  register :bn, BN
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :cs)
11
11
  SCALES = I18n.t("num2words.scales", locale: :cs)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.CZK.name", locale: :cs)
14
- MINOR_UNIT = I18n.t("num2words.currencies.CZK.fractional.name", locale: :cs)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :cs)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :cs)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :cs)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :cs)
18
+ TIME = I18n.t("num2words.time", locale: :cs)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :cs)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :cs)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :cs)
15
23
  end
16
24
 
17
25
  register :cs, CS
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :da)
11
11
  SCALES = I18n.t("num2words.scales", locale: :da)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.DKK.name", locale: :da)
14
- MINOR_UNIT = I18n.t("num2words.currencies.DKK.fractional.name", locale: :da)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :da)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :da)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :da)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :da)
18
+ TIME = I18n.t("num2words.time", locale: :da)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :da)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :da)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :da)
15
23
  end
16
24
 
17
25
  register :da, DA
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :de)
11
11
  SCALES = I18n.t("num2words.scales", locale: :de)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.EUR.name", locale: :de)
14
- MINOR_UNIT = I18n.t("num2words.currencies.EUR.fractional.name", locale: :de)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :de)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :de)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :de)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :de)
18
+ TIME = I18n.t("num2words.time", locale: :de)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :de)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :de)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :de)
15
23
  end
16
24
 
17
25
  register :de, DE
@@ -10,8 +10,16 @@ module Num2words
10
10
  HUNDREDS = I18n.t("num2words.hundreds", locale: :el)
11
11
  SCALES = I18n.t("num2words.scales", locale: :el)
12
12
 
13
- MAJOR_UNIT = I18n.t("num2words.currencies.EUR.name", locale: :el)
14
- MINOR_UNIT = I18n.t("num2words.currencies.EUR.fractional.name", locale: :el)
13
+ FRACTIONS = I18n.t("num2words.fractions", locale: :el)
14
+ GRAMMAR = I18n.t("num2words.grammar", locale: :el)
15
+
16
+ DATE = I18n.t("num2words.date", locale: :el)
17
+ DATE_TEMPLATE = I18n.t("num2words.date.template", locale: :el)
18
+ TIME = I18n.t("num2words.time", locale: :el)
19
+ TIME_TEMPLATE = I18n.t("num2words.time.template", locale: :el)
20
+ DATETIME_TEMPLATE = I18n.t("num2words.datetime.template", locale: :el)
21
+
22
+ ORDINALS = I18n.t("num2words.numbers.ordinals", locale: :el)
15
23
  end
16
24
 
17
25
  register :el, EL
@@ -10,9 +10,6 @@ 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
 
@@ -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