r18n-core 3.1.1 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +398 -0
  3. data/README.md +63 -47
  4. data/base/cy.yml +34 -0
  5. data/lib/r18n-core.rb +37 -38
  6. data/lib/r18n-core/filter_list.rb +21 -13
  7. data/lib/r18n-core/filters.rb +43 -48
  8. data/lib/r18n-core/helpers.rb +2 -2
  9. data/lib/r18n-core/i18n.rb +70 -78
  10. data/lib/r18n-core/locale.rb +137 -107
  11. data/lib/r18n-core/locales/af.rb +36 -0
  12. data/lib/r18n-core/locales/az.rb +38 -0
  13. data/lib/r18n-core/locales/bg.rb +29 -0
  14. data/{locales → lib/r18n-core/locales}/ca.rb +9 -6
  15. data/{locales → lib/r18n-core/locales}/cs.rb +15 -11
  16. data/lib/r18n-core/locales/cy.rb +50 -0
  17. data/{locales → lib/r18n-core/locales}/da.rb +10 -7
  18. data/lib/r18n-core/locales/de.rb +33 -0
  19. data/{locales → lib/r18n-core/locales}/en-au.rb +2 -2
  20. data/{locales → lib/r18n-core/locales}/en-gb.rb +2 -2
  21. data/{locales → lib/r18n-core/locales}/en-us.rb +4 -3
  22. data/lib/r18n-core/locales/en.rb +51 -0
  23. data/{locales → lib/r18n-core/locales}/eo.rb +6 -4
  24. data/lib/r18n-core/locales/es-cl.rb +16 -0
  25. data/{locales → lib/r18n-core/locales}/es-us.rb +5 -4
  26. data/{locales → lib/r18n-core/locales}/es.rb +7 -3
  27. data/{locales → lib/r18n-core/locales}/fa.rb +2 -2
  28. data/lib/r18n-core/locales/fi.rb +39 -0
  29. data/lib/r18n-core/locales/fr.rb +39 -0
  30. data/{locales → lib/r18n-core/locales}/gl.rb +5 -3
  31. data/{locales → lib/r18n-core/locales}/hr.rb +13 -10
  32. data/{locales → lib/r18n-core/locales}/hu.rb +10 -7
  33. data/{locales → lib/r18n-core/locales}/id.rb +8 -4
  34. data/lib/r18n-core/locales/it.rb +37 -0
  35. data/{locales → lib/r18n-core/locales}/ja.rb +5 -4
  36. data/{locales → lib/r18n-core/locales}/kk.rb +12 -8
  37. data/{locales → lib/r18n-core/locales}/ko.rb +0 -0
  38. data/lib/r18n-core/locales/lv.rb +46 -0
  39. data/lib/r18n-core/locales/mn.rb +30 -0
  40. data/{locales → lib/r18n-core/locales}/nb.rb +6 -4
  41. data/lib/r18n-core/locales/nl.rb +31 -0
  42. data/{locales → lib/r18n-core/locales}/no.rb +0 -0
  43. data/lib/r18n-core/locales/pl.rb +45 -0
  44. data/{locales → lib/r18n-core/locales}/pt-br.rb +1 -1
  45. data/lib/r18n-core/locales/pt.rb +37 -0
  46. data/lib/r18n-core/locales/ru.rb +46 -0
  47. data/{locales → lib/r18n-core/locales}/sk.rb +13 -9
  48. data/{locales → lib/r18n-core/locales}/sr-latn.rb +10 -8
  49. data/{locales → lib/r18n-core/locales}/sv-se.rb +7 -5
  50. data/lib/r18n-core/locales/th.rb +41 -0
  51. data/{locales → lib/r18n-core/locales}/tr.rb +7 -6
  52. data/lib/r18n-core/locales/uk.rb +31 -0
  53. data/lib/r18n-core/locales/vi.rb +37 -0
  54. data/{locales → lib/r18n-core/locales}/zh-cn.rb +2 -2
  55. data/{locales → lib/r18n-core/locales}/zh-tw.rb +4 -4
  56. data/{locales → lib/r18n-core/locales}/zh.rb +7 -4
  57. data/lib/r18n-core/translated.rb +38 -37
  58. data/lib/r18n-core/translated_string.rb +19 -8
  59. data/lib/r18n-core/translation.rb +24 -19
  60. data/lib/r18n-core/unsupported_locale.rb +14 -6
  61. data/lib/r18n-core/untranslated.rb +23 -7
  62. data/lib/r18n-core/utils.rb +19 -23
  63. data/lib/r18n-core/version.rb +1 -1
  64. data/lib/r18n-core/yaml_loader.rb +17 -13
  65. data/lib/r18n-core/yaml_methods.rb +3 -1
  66. metadata +245 -118
  67. data/.rspec +0 -1
  68. data/Rakefile +0 -13
  69. data/locales/af.rb +0 -32
  70. data/locales/az.rb +0 -34
  71. data/locales/bg.rb +0 -25
  72. data/locales/de.rb +0 -29
  73. data/locales/en.rb +0 -48
  74. data/locales/fi.rb +0 -35
  75. data/locales/fr.rb +0 -35
  76. data/locales/it.rb +0 -34
  77. data/locales/lv.rb +0 -41
  78. data/locales/mn.rb +0 -27
  79. data/locales/nl.rb +0 -28
  80. data/locales/pl.rb +0 -40
  81. data/locales/pt.rb +0 -29
  82. data/locales/ru.rb +0 -41
  83. data/locales/th.rb +0 -37
  84. data/locales/uk.rb +0 -27
  85. data/locales/vi.rb +0 -33
  86. data/r18n-core.gemspec +0 -29
  87. data/spec/filters_spec.rb +0 -324
  88. data/spec/i18n_spec.rb +0 -260
  89. data/spec/locale_spec.rb +0 -216
  90. data/spec/locales/cs_spec.rb +0 -23
  91. data/spec/locales/en-us_spec.rb +0 -13
  92. data/spec/locales/en_spec.rb +0 -13
  93. data/spec/locales/fa_spec.rb +0 -10
  94. data/spec/locales/fr_spec.rb +0 -9
  95. data/spec/locales/hu_spec.rb +0 -17
  96. data/spec/locales/it_spec.rb +0 -10
  97. data/spec/locales/no_spec.rb +0 -9
  98. data/spec/locales/pl_spec.rb +0 -23
  99. data/spec/locales/ru_spec.rb +0 -23
  100. data/spec/locales/sk_spec.rb +0 -23
  101. data/spec/locales/th_spec.rb +0 -9
  102. data/spec/locales/vi_spec.rb +0 -8
  103. data/spec/r18n_spec.rb +0 -172
  104. data/spec/spec_helper.rb +0 -41
  105. data/spec/translated_spec.rb +0 -163
  106. data/spec/translation_spec.rb +0 -164
  107. data/spec/translations/extension/deep/en.yml +0 -1
  108. data/spec/translations/extension/en.yml +0 -2
  109. data/spec/translations/extension/notransl.yml +0 -1
  110. data/spec/translations/general/en.yml +0 -47
  111. data/spec/translations/general/nolocale.yml +0 -6
  112. data/spec/translations/general/ru.yml +0 -7
  113. data/spec/translations/two/en.yml +0 -2
  114. data/spec/translations/two/fr.yml +0 -0
  115. data/spec/yaml_loader_spec.rb +0 -61
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --format documentation --colour --warnings --require spec_helper
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/setup'
4
- Bundler::GemHelper.install_tasks
5
-
6
- require 'rspec/core/rake_task'
7
- RSpec::Core::RakeTask.new
8
- task default: :spec
9
-
10
- task :clobber_package do
11
- rm_rf 'pkg'
12
- end
13
- task clobber: [:clobber_package]
data/locales/af.rb DELETED
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # Afrikaans locale
6
- class Af < Locale
7
- set(
8
- title: 'Afrikaans',
9
-
10
- week_start: :sondag,
11
- wday_names: %w[Sondag Maandag Dinsdag Woensdag Donderdag Vrydag
12
- Saterdag],
13
- wday_abbrs: %w[So Ma Di Wo Do Vr Sa],
14
-
15
- month_names: %w[Januarie Februarie Maart April Mei Junie Julie Augustus
16
- September Oktober November Desember],
17
- month_abbrs: %w[Jan Feb Mrt Apr Mei Jun Jul Aug Sep Okt Nov Des],
18
-
19
- time_am: "'s voormiddag",
20
- time_pm: "'s namiddag",
21
-
22
- date_format: '%d/%m/%Y',
23
- full_format: '%e %B',
24
- year_format: '_, %Y',
25
- time_format: '_, %H:%M',
26
-
27
- number_decimal: '.',
28
- number_group: ','
29
- )
30
- end
31
- end
32
- end
data/locales/az.rb DELETED
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # Azerbaijani locale
6
- class Az < Locale
7
- set(
8
- title: 'Azərbaycanca',
9
-
10
- wday_names: %w[Bazar BazarErtəsi ÇərşənbəAxşamı Çərşənbə CüməAxşamı Cümə
11
- Şənbə],
12
- wday_abbrs: %w[B. B.e Ç.a Ç. C.a C. Ş.],
13
-
14
- month_names: %w[yanvar fevral mart aprel may iyun iyul avqust
15
- sentyabr oktyabr noyabr dekabr],
16
- month_abbrs: %w[yan fev mar apr may iyn iyl avq sen okt noy dek],
17
- month_standalone: %w[Yanvar Fevral Mart Aprel May İyun İyul Avqust
18
- Sentyabr Oktyabr Noyabr Dekabr],
19
-
20
- time_am: ' gündüz',
21
- time_pm: ' axşam',
22
- date_format: '%d.%m.%Y',
23
- time_format: '_%H:%M',
24
-
25
- number_decimal: ',',
26
- number_group: ' '
27
- )
28
-
29
- def pluralize(_n)
30
- 'n'
31
- end
32
- end
33
- end
34
- end
data/locales/bg.rb DELETED
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # Bulgarian locale
6
- class Bg < Locale
7
- set(
8
- title: 'Български',
9
-
10
- wday_names: %w[Неделя Понеделник Вторник Сряда Четвъртък Петък Събота],
11
- wday_abbrs: %w[Нед Пон Вто Сря Чет Пет Съб],
12
-
13
- month_names: %w[Януари Февруари Март Април Май Юни Юли Август
14
- Септември Октомври Ноември Декември],
15
- month_abbrs: %w[Яну Фев Мар Апр Май Юни Юли Авг Сеп Окт Ное Дек],
16
- month_standalone: %w[Януари Февруари Март Април Май Юни Юли Август
17
- Септември Октомври Ноември Декември],
18
- date_format: '%d.%m.%Y',
19
-
20
- number_decimal: ',',
21
- number_group: ' '
22
- )
23
- end
24
- end
25
- end
data/locales/de.rb DELETED
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # German locale
6
- class De < Locale
7
- set(
8
- title: 'Deutsch',
9
-
10
- wday_names: %w[Sonntag Montag Dienstag Mittwoch Donnerstag Freitag
11
- Samstag],
12
- wday_abbrs: %w[So Mo Di Mi Do Fr Sa],
13
-
14
- month_names: %w[Januar Februar März April Mai Juni Juli August
15
- September Oktober November Dezember],
16
- month_abbrs: %w[Jan. Feb. Mär. Apr. Mai. Jun. Jul. Aug. Sep. Okt.
17
- Nov. Dez.],
18
-
19
- time_am: 'vormittags',
20
- time_pm: 'nachmittags',
21
- date_format: '%d.%m.%Y',
22
- full_format: '%e. %B',
23
-
24
- number_decimal: ',',
25
- number_group: '.'
26
- )
27
- end
28
- end
29
- end
data/locales/en.rb DELETED
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # English locale
6
- class En < Locale
7
- set(
8
- title: 'English',
9
- sublocales: [],
10
-
11
- week_start: :sunday,
12
- wday_names: %w[Sunday Monday Tuesday Wednesday Thursday Friday
13
- Saturday],
14
- wday_abbrs: %w[Sun Mon Tue Wed Thu Fri Sat],
15
-
16
- month_names: %w[January February March April May June July August
17
- September October November December],
18
- month_abbrs: %w[Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec],
19
-
20
- date_format: '%Y-%m-%d',
21
- full_format: '%e of %B',
22
- year_format: '_, %Y',
23
-
24
- number_decimal: '.',
25
- number_group: ','
26
- )
27
-
28
- def ordinalize(n)
29
- if (11..13).cover?(n % 100)
30
- "#{n}th"
31
- else
32
- case n % 10
33
- when 1 then "#{n}st"
34
- when 2 then "#{n}nd"
35
- when 3 then "#{n}rd"
36
- else "#{n}th"
37
- end
38
- end
39
- end
40
-
41
- def format_date_full(date, year = true, *_params)
42
- format = full_format
43
- format = year_format.sub('_', format) if year
44
- strftime(date, format.sub('%e', ordinalize(date.mday)))
45
- end
46
- end
47
- end
48
- end
data/locales/fi.rb DELETED
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # Finnish locale
6
- class Fi < Locale
7
- set(
8
- title: 'Suomi',
9
-
10
- wday_names: %w[sunnuntai maanantai tiistai keskiviikko torstai
11
- terjantai lauantai],
12
- wday_abbrs: %w[su ma ti ke to te la],
13
-
14
- month_names: %w[tammikuuta helmikuuta maaliskuuta huhtikuuta
15
- toukokuuta kesäkuuta heinäkuuta elokuuta syyskuuta
16
- lokakuuta marraskuuta joulukuuta],
17
- month_abbrs: %w[tam hel maa huh tou kes hei elo syy lok mar jou],
18
- month_standalone: %w[tammikuu helmikuu maaliskuu huhtikuu toukokuu
19
- kesäkuu heinäkuu elokuu syyskuu lokakuu
20
- marraskuu joulukuu],
21
-
22
- date_format: '%d.%m.%Y',
23
- full_format: '%e. %B',
24
- time_format: '_ %H.%M',
25
-
26
- number_decimal: ',',
27
- number_group: ''
28
- )
29
-
30
- def format_time_full(time, *_params)
31
- format_time(format_date_full(time) + ' kello', time)
32
- end
33
- end
34
- end
35
- end
data/locales/fr.rb DELETED
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # French locale
6
- class Fr < Locale
7
- set(
8
- title: 'Français',
9
-
10
- wday_names: %w[dimanche lundi mardi mercredi jeudi vendredi samedi],
11
- wday_abbrs: %w[dim lun mar mer jeu ven sam],
12
-
13
- month_names: %w[janvier février mars avril mai juin juillet août
14
- septembre octobre novembre décembre],
15
- month_abbrs: %w[jan fév mar avr mai jun jui aoû sep oct nov déc],
16
- month_standalone: %w[Janvier Février Mars Avril Mai Juin Juillet Août
17
- Septembre Octobre Novembre Décembre],
18
-
19
- date_format: '%d/%m/%Y',
20
-
21
- number_decimal: ',',
22
- number_group: ' '
23
- )
24
-
25
- def format_date_full(date, year = true, *_params)
26
- full = super(date, year)
27
- if full[0..1] == ' 1'
28
- '1er' + full[2..-1]
29
- else
30
- full
31
- end
32
- end
33
- end
34
- end
35
- end
data/locales/it.rb DELETED
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # Italian locale
6
- class It < Locale
7
- set(
8
- title: 'Italiano',
9
-
10
- wday_names: %w[domenica lunedì martedì mercoledì giovedì venerdì
11
- sabato],
12
- wday_abbrs: %w[dom lun mar mer gio ven sab],
13
-
14
- month_names: %w[gennaio febbraio marzo aprile maggio giugno
15
- luglio agosto settembre ottobre novembre dicembre],
16
- month_abbrs: %w[gen feb mar apr mag giu lug ago set ott nov dic],
17
-
18
- date_format: '%d/%m/%Y',
19
-
20
- number_decimal: ',',
21
- number_group: ' '
22
- )
23
-
24
- def format_date_full(date, year = true, *_params)
25
- full = super(date, year)
26
- if full[0..1] == ' 1'
27
- '1º' + full[2..-1]
28
- else
29
- full
30
- end
31
- end
32
- end
33
- end
34
- end
data/locales/lv.rb DELETED
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # Latvian locale
6
- class Lv < Locale
7
- set(
8
- title: 'Latviešu',
9
-
10
- week_start: :monday,
11
- wday_names: %w[Svētdiena Pirmdiena Otrdiena Trešdiena Ceturtdiena
12
- Piektdiena Sestdiena],
13
- wday_abbrs: %w[Sv P O T C P S],
14
-
15
- month_names: %w[janvārī februārī martā aprīlī maijā jūnijā jūlijā
16
- augustā septembrī oktobrī novembrī decembrī],
17
- month_abbrs: %w[jan feb mar apr mai jūn jūl aug sep okt nov dec],
18
- month_standalone: %w[janvāris februāris marts aprīlis maijs jūnijs
19
- jūlijs augusts septembris oktobris novembris
20
- decembris],
21
-
22
- date_format: '%d.%m.%Y.',
23
- full_format: '%e.%B',
24
- year_format: '%Y.gada _',
25
-
26
- number_decimal: ',',
27
- number_group: ' '
28
- )
29
-
30
- def pluralize(n)
31
- if n.zero?
32
- 0
33
- elsif n % 10 == 1 && n % 100 != 11
34
- 1
35
- else
36
- 'n'
37
- end
38
- end
39
- end
40
- end
41
- end
data/locales/mn.rb DELETED
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # Mongolian locale
6
- class Mn < Locale
7
- set(
8
- title: 'Монгол',
9
-
10
- wday_names: ['Ням гариг', 'Даваа гариг', 'Мягмар гариг', 'Лхагва гариг',
11
- 'Пүрэв гариг', 'Баасан гариг', 'Бямба гариг'],
12
- wday_abbrs: %w[ня да мя лх пү ба бя],
13
-
14
- month_names: ['Нэгдүгээр сар', 'Хоёрдугаар сар', 'Гуравдугаар сар',
15
- 'Дөрөвдүгээр сар', 'Тавдугаар сар', 'Зургадугаар сар',
16
- 'Долдугаар сар', 'Наймдугаар сар', 'Есдүгээр сар',
17
- 'Аравдугаар сар', 'Арваннэгдүгээр сар',
18
- 'Арванхоёрдугаар сар'],
19
-
20
- date_format: '%Y-%m-%d',
21
-
22
- number_decimal: ',',
23
- number_group: '.'
24
- )
25
- end
26
- end
27
- end
data/locales/nl.rb DELETED
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # Dutch locale
6
- class Nl < Locale
7
- set(
8
- title: 'Nederlands',
9
-
10
- wday_names: %w[zondag maandag dinsdag woensdag donderdag vrijdag
11
- zaterdag],
12
- wday_abbrs: %w[zo ma di wo do vr za],
13
-
14
- month_names: %w[januari februari maart april mei juni juli augustus
15
- september oktober november december],
16
- month_abbrs: %w[jan feb mrt apr mei jun jul aug sep okt nov dec],
17
-
18
- time_am: "'s ochtends",
19
- time_pm: "'s middags",
20
- date_format: '%d-%m-%Y',
21
- full_format: '%e %B',
22
-
23
- number_decimal: ',',
24
- number_group: '.'
25
- )
26
- end
27
- end
28
- end
data/locales/pl.rb DELETED
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module R18n
4
- module Locales
5
- # Polish locale
6
- class Pl < Locale
7
- set(
8
- title: 'Polski',
9
-
10
- wday_names: %w[niedziela poniedziałek wtorek środa czwartek piątek
11
- sobota],
12
- wday_abbrs: %w[nd pn wt śr czw pt sob],
13
-
14
- month_names: %w[stycznia lutego marca kwietnia maja czerwca lipca
15
- sierpnia września października listopada grudnia],
16
- month_abbrs: %w[I II III IV V VI VII VIII IX X XI XII],
17
- month_standalone: %w[styczeń luty marzec kwiecień maj czerwiec lipiec
18
- sierpień wrzesień październik listopad
19
- grudzień],
20
-
21
- date_format: '%d.%m.%Y',
22
-
23
- number_decimal: ',',
24
- number_group: ' '
25
- )
26
-
27
- def pluralize(n)
28
- return 0 if n.zero?
29
- case n % 10
30
- when 1
31
- n > 10 ? 'n' : 1
32
- when 2..4
33
- (11..19).cover?(n % 100) ? 'n' : 2
34
- else
35
- 'n'
36
- end
37
- end
38
- end
39
- end
40
- end