bigcartel-currency-locales 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.travis.yml +12 -0
  4. data/Appraisals +19 -0
  5. data/Gemfile +3 -0
  6. data/README.md +23 -0
  7. data/Rakefile +25 -0
  8. data/bigcartel-currency-locales.gemspec +21 -0
  9. data/gemfiles/2.3.gemfile +10 -0
  10. data/gemfiles/2.3.gemfile.lock +44 -0
  11. data/gemfiles/3.0.gemfile +8 -0
  12. data/gemfiles/3.0.gemfile.lock +99 -0
  13. data/gemfiles/3.1.gemfile +8 -0
  14. data/gemfiles/3.1.gemfile.lock +110 -0
  15. data/gemfiles/3.2.gemfile +8 -0
  16. data/gemfiles/3.2.gemfile.lock +109 -0
  17. data/lib/currency-locales.rb +12 -0
  18. data/lib/currency-locales/locales/cs.yml +26 -0
  19. data/lib/currency-locales/locales/da.yml +26 -0
  20. data/lib/currency-locales/locales/en-AU.yml +26 -0
  21. data/lib/currency-locales/locales/en-GB.yml +26 -0
  22. data/lib/currency-locales/locales/en-PH.yml +27 -0
  23. data/lib/currency-locales/locales/en-US.yml +26 -0
  24. data/lib/currency-locales/locales/es-MX.yml +26 -0
  25. data/lib/currency-locales/locales/eu.yml +26 -0
  26. data/lib/currency-locales/locales/gsw-CH.yml +26 -0
  27. data/lib/currency-locales/locales/hu.yml +26 -0
  28. data/lib/currency-locales/locales/il.yml +26 -0
  29. data/lib/currency-locales/locales/ja.yml +30 -0
  30. data/lib/currency-locales/locales/ms-MY.yml +26 -0
  31. data/lib/currency-locales/locales/nb.yml +22 -0
  32. data/lib/currency-locales/locales/pl.yml +27 -0
  33. data/lib/currency-locales/locales/pt-BR.yml +26 -0
  34. data/lib/currency-locales/locales/sv-SE.yml +26 -0
  35. data/lib/currency-locales/locales/th.yml +26 -0
  36. data/lib/currency-locales/locales/tr.yml +29 -0
  37. data/lib/currency-locales/locales/zh-TW.yml +30 -0
  38. data/lib/currency-locales/railtie.rb +11 -0
  39. data/lib/currency-locales/version.rb +5 -0
  40. data/rails/init.rb +1 -0
  41. data/spec/integration/currency_locales_spec.rb +421 -0
  42. data/spec/spec_helper.rb +27 -0
  43. metadata +125 -0
@@ -0,0 +1,26 @@
1
+ "sv-SE":
2
+ number:
3
+ format:
4
+ separator: ","
5
+ delimiter: ""
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%n%u"
13
+ unit: "kr"
14
+ separator: ","
15
+ delimiter: ""
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: ""
@@ -0,0 +1,26 @@
1
+ th:
2
+ number:
3
+ format:
4
+ separator: "."
5
+ delimiter: ","
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%n%u"
13
+ unit: "฿"
14
+ separator: "."
15
+ delimiter: ","
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: ","
@@ -0,0 +1,29 @@
1
+ tr:
2
+ number:
3
+ format:
4
+ separator: ","
5
+ delimiter: "."
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%n %u"
13
+ unit: "TL"
14
+ separator: ","
15
+ delimiter: "."
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: '.'
23
+ separator: ','
24
+ precision: 2
25
+
26
+ precision:
27
+ format:
28
+ delimiter: '.'
29
+ separator: ','
@@ -0,0 +1,30 @@
1
+ "zh-TW":
2
+ number:
3
+ format:
4
+ separator: "."
5
+ delimiter: ","
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%u%n"
13
+ unit: "NT$"
14
+ separator: "."
15
+ delimiter: ","
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: ","
27
+
28
+ paypal:
29
+ format:
30
+ precision: 0
@@ -0,0 +1,11 @@
1
+ module BigCartel
2
+ module CurrencyLocales
3
+ require 'rails'
4
+
5
+ class Railtie < ::Rails::Railtie
6
+ initializer 'currency-locales' do |app|
7
+ BigCartel::CurrencyLocales.insert
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module BigCartel
2
+ module CurrencyLocales
3
+ VERSION = "1.3.0"
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ BigCartel::CurrencyLocales.insert
@@ -0,0 +1,421 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "CurrencyLocales" do
6
+ let(:small_amount) { 9.99 }
7
+ let(:small_currency) { number_to_currency(small_amount) }
8
+ let(:small_precision) { number_with_precision(small_amount) }
9
+
10
+ let(:big_amount) { 9999.99 }
11
+ let(:big_currency) { number_to_currency(big_amount) }
12
+ let(:big_precision) { number_with_precision(big_amount) }
13
+
14
+ def number_to_currency(number)
15
+ ActionController::Base.helpers.number_to_currency(number, :locale => locale)
16
+ end
17
+
18
+ def number_with_precision(number)
19
+ ActionController::Base.helpers.number_with_precision(number, :locale => locale)
20
+ end
21
+
22
+ describe "cs" do
23
+ let(:locale) { 'cs' }
24
+
25
+ it "should translate the small amount to currency" do
26
+ small_currency.should == '9,99Kč'
27
+ end
28
+
29
+ it "should translate the big amount to currency" do
30
+ big_currency.should == '9999,99Kč'
31
+ end
32
+
33
+ it "should translate the small amount with precision" do
34
+ small_precision.should == '9,99'
35
+ end
36
+
37
+ it "should translate the big amount with precision" do
38
+ big_precision.should == '9999,99'
39
+ end
40
+ end
41
+
42
+ describe "da" do
43
+ let(:locale) { 'da' }
44
+
45
+ it "should translate the small amount to currency" do
46
+ small_currency.should == 'kr9,99'
47
+ end
48
+
49
+ it "should translate the big amount to currency" do
50
+ big_currency.should == 'kr9.999,99'
51
+ end
52
+
53
+ it "should translate the small amount with precision" do
54
+ small_precision.should == '9,99'
55
+ end
56
+
57
+ it "should translate the big amount with precision" do
58
+ big_precision.should == '9.999,99'
59
+ end
60
+ end
61
+
62
+ describe "en-AU" do
63
+ let(:locale) { 'en-AU' }
64
+
65
+ it "should translate the small amount to currency" do
66
+ small_currency.should == '$9.99'
67
+ end
68
+
69
+ it "should translate the big amount to currency" do
70
+ big_currency.should == '$9,999.99'
71
+ end
72
+
73
+ it "should translate the small amount with precision" do
74
+ small_precision.should == '9.99'
75
+ end
76
+
77
+ it "should translate the big amount with precision" do
78
+ big_precision.should == '9,999.99'
79
+ end
80
+ end
81
+
82
+ describe "en-GB" do
83
+ let(:locale) { 'en-GB' }
84
+
85
+ it "should translate the small amount to currency" do
86
+ small_currency.should == '£9.99'
87
+ end
88
+
89
+ it "should translate the big amount to currency" do
90
+ big_currency.should == '£9,999.99'
91
+ end
92
+
93
+ it "should translate the small amount with precision" do
94
+ small_precision.should == '9.99'
95
+ end
96
+
97
+ it "should translate the big amount with precision" do
98
+ big_precision.should == '9,999.99'
99
+ end
100
+ end
101
+
102
+ describe "en-PH" do
103
+ let(:locale) { 'en-PH' }
104
+
105
+ it "should translate the small amount to currency" do
106
+ small_currency.should == '₱9.99'
107
+ end
108
+
109
+ it "should translate the big amount to currency" do
110
+ big_currency.should == '₱9,999.99'
111
+ end
112
+
113
+ it "should translate the small amount with precision" do
114
+ small_precision.should == '9.99'
115
+ end
116
+
117
+ it "should translate the big amount with precision" do
118
+ big_precision.should == '9,999.99'
119
+ end
120
+ end
121
+
122
+ describe "es-MX" do
123
+ let(:locale) { 'es-MX' }
124
+
125
+ it "should translate the small amount to currency" do
126
+ small_currency.should == '$9.99'
127
+ end
128
+
129
+ it "should translate the big amount to currency" do
130
+ big_currency.should == '$9,999.99'
131
+ end
132
+
133
+ it "should translate the small amount with precision" do
134
+ small_precision.should == '9.99'
135
+ end
136
+
137
+ it "should translate the big amount with precision" do
138
+ big_precision.should == '9,999.99'
139
+ end
140
+ end
141
+
142
+ describe "en-US" do
143
+ let(:locale) { 'en-US' }
144
+
145
+ it "should translate the small amount to currency" do
146
+ small_currency.should == '$9.99'
147
+ end
148
+
149
+ it "should translate the big amount to currency" do
150
+ big_currency.should == '$9,999.99'
151
+ end
152
+
153
+ it "should translate the small amount with precision" do
154
+ small_precision.should == '9.99'
155
+ end
156
+
157
+ it "should translate the big amount with precision" do
158
+ big_precision.should == '9,999.99'
159
+ end
160
+ end
161
+
162
+ describe "eu" do
163
+ let(:locale) { 'eu' }
164
+
165
+ it "should translate the small amount to currency" do
166
+ small_currency.should == '€9.99'
167
+ end
168
+
169
+ it "should translate the big amount to currency" do
170
+ big_currency.should == '€9,999.99'
171
+ end
172
+
173
+ it "should translate the small amount with precision" do
174
+ small_precision.should == '9.99'
175
+ end
176
+
177
+ it "should translate the big amount with precision" do
178
+ big_precision.should == '9,999.99'
179
+ end
180
+ end
181
+
182
+ describe "gsw-CH" do
183
+ let(:locale) { 'gsw-CH' }
184
+
185
+ it "should translate the small amount to currency" do
186
+ small_currency.should == 'SFr.9.99'
187
+ end
188
+
189
+ it "should translate the big amount to currency" do
190
+ big_currency.should == 'SFr.9,999.99'
191
+ end
192
+
193
+ it "should translate the small amount with precision" do
194
+ small_precision.should == '9.99'
195
+ end
196
+
197
+ it "should translate the big amount with precision" do
198
+ big_precision.should == '9,999.99'
199
+ end
200
+ end
201
+
202
+ describe "hu" do
203
+ let(:locale) { 'hu' }
204
+
205
+ it "should translate the small amount to currency" do
206
+ small_currency.should == '10Ft'
207
+ end
208
+
209
+ it "should translate the big amount to currency" do
210
+ big_currency.should == '10000Ft'
211
+ end
212
+
213
+ it "should translate the small amount with precision" do
214
+ small_precision.should == '9,99'
215
+ end
216
+
217
+ it "should translate the big amount with precision" do
218
+ big_precision.should == '9999,99'
219
+ end
220
+ end
221
+
222
+ describe "il" do
223
+ let(:locale) { 'il' }
224
+
225
+ it "should translate the small amount to currency" do
226
+ small_currency.should == '₪9.99'
227
+ end
228
+
229
+ it "should translate the big amount to currency" do
230
+ big_currency.should == '₪9,999.99'
231
+ end
232
+
233
+ it "should translate the small amount with precision" do
234
+ small_precision.should == '9.99'
235
+ end
236
+
237
+ it "should translate the big amount with precision" do
238
+ big_precision.should == '9,999.99'
239
+ end
240
+ end
241
+
242
+ describe "ja" do
243
+ let(:locale) { 'ja' }
244
+
245
+ it "should translate the small amount to currency" do
246
+ small_currency.should == '¥10'
247
+ end
248
+
249
+ it "should translate the big amount to currency" do
250
+ big_currency.should == '¥10,000'
251
+ end
252
+
253
+ it "should translate the small amount with precision" do
254
+ small_precision.should == '9.99'
255
+ end
256
+
257
+ it "should translate the big amount with precision" do
258
+ big_precision.should == '9,999.99'
259
+ end
260
+ end
261
+
262
+ describe "ms-MY" do
263
+ let(:locale) { 'ms-MY' }
264
+
265
+ it "should translate the small amount to currency" do
266
+ small_currency.should == 'RM9.99'
267
+ end
268
+
269
+ it "should translate the big amount to currency" do
270
+ big_currency.should == 'RM9,999.99'
271
+ end
272
+
273
+ it "should translate the small amount with precision" do
274
+ small_precision.should == '9.99'
275
+ end
276
+
277
+ it "should translate the big amount with precision" do
278
+ big_precision.should == '9,999.99'
279
+ end
280
+ end
281
+
282
+ describe "nb" do
283
+ let(:locale) { 'nb' }
284
+
285
+ it "should translate the small amount to currency" do
286
+ small_currency.should == '9,99kr'
287
+ end
288
+
289
+ it "should translate the big amount to currency" do
290
+ big_currency.should == '9999,99kr'
291
+ end
292
+
293
+ it "should translate the small amount with precision" do
294
+ small_precision.should == '9,99'
295
+ end
296
+
297
+ it "should translate the big amount with precision" do
298
+ big_precision.should == '9999,99'
299
+ end
300
+ end
301
+
302
+ describe "pl" do
303
+ let(:locale) { 'pl' }
304
+
305
+ it "should translate the small amount to currency" do
306
+ small_currency.should == '9,99zł'
307
+ end
308
+
309
+ it "should translate the big amount to currency" do
310
+ big_currency.should == '9999,99zł'
311
+ end
312
+
313
+ it "should translate the small amount with precision" do
314
+ small_precision.should == '9,99'
315
+ end
316
+
317
+ it "should translate the big amount with precision" do
318
+ big_precision.should == '9999,99'
319
+ end
320
+ end
321
+
322
+ describe "pt-BR" do
323
+ let(:locale) { 'pt-BR' }
324
+
325
+ it "should translate the small amount to currency" do
326
+ small_currency.should == 'R$9,99'
327
+ end
328
+
329
+ it "should translate the big amount to currency" do
330
+ big_currency.should == 'R$9.999,99'
331
+ end
332
+
333
+ it "should translate the small amount with precision" do
334
+ small_precision.should == '9,99'
335
+ end
336
+
337
+ it "should translate the big amount with precision" do
338
+ big_precision.should == '9.999,99'
339
+ end
340
+ end
341
+
342
+ describe "sv-SE" do
343
+ let(:locale) { 'sv-SE' }
344
+
345
+ it "should translate the small amount to currency" do
346
+ small_currency.should == '9,99kr'
347
+ end
348
+
349
+ it "should translate the big amount to currency" do
350
+ big_currency.should == '9999,99kr'
351
+ end
352
+
353
+ it "should translate the small amount with precision" do
354
+ small_precision.should == '9,99'
355
+ end
356
+
357
+ it "should translate the big amount with precision" do
358
+ big_precision.should == '9999,99'
359
+ end
360
+ end
361
+
362
+ describe "th" do
363
+ let(:locale) { 'th' }
364
+
365
+ it "should translate the small amount to currency" do
366
+ small_currency.should == '9.99฿'
367
+ end
368
+
369
+ it "should translate the big amount to currency" do
370
+ big_currency.should == '9,999.99฿'
371
+ end
372
+
373
+ it "should translate the small amount with precision" do
374
+ small_precision.should == '9.99'
375
+ end
376
+
377
+ it "should translate the big amount with precision" do
378
+ big_precision.should == '9,999.99'
379
+ end
380
+ end
381
+
382
+ describe "tr" do
383
+ let(:locale) { 'tr' }
384
+
385
+ it "should translate the small amount to currency" do
386
+ small_currency.should == '9,99 TL'
387
+ end
388
+
389
+ it "should translate the big amount to currency" do
390
+ big_currency.should == '9.999,99 TL'
391
+ end
392
+
393
+ it "should translate the small amount with precision" do
394
+ small_precision.should == '9,99'
395
+ end
396
+
397
+ it "should translate the big amount with precision" do
398
+ big_precision.should == '9.999,99'
399
+ end
400
+ end
401
+
402
+ describe "zh-TW" do
403
+ let(:locale) { 'zh-TW' }
404
+
405
+ it "should translate the small amount to currency" do
406
+ small_currency.should == 'NT$9.99'
407
+ end
408
+
409
+ it "should translate the big amount to currency" do
410
+ big_currency.should == 'NT$9,999.99'
411
+ end
412
+
413
+ it "should translate the small amount with precision" do
414
+ small_precision.should == '9.99'
415
+ end
416
+
417
+ it "should translate the big amount with precision" do
418
+ big_precision.should == '9,999.99'
419
+ end
420
+ end
421
+ end