dotiw 4.0.1 → 5.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +45 -0
  3. data/.rspec +2 -0
  4. data/Appraisals +19 -0
  5. data/CHANGELOG.md +42 -6
  6. data/Gemfile +2 -0
  7. data/MIT-LICENSE +1 -1
  8. data/README.markdown +151 -63
  9. data/Rakefile +3 -1
  10. data/benchmarks/time_hash_bench.rb +19 -0
  11. data/dotiw.gemspec +17 -19
  12. data/gemfiles/rails_4.gemfile +5 -3
  13. data/gemfiles/rails_5.0.gemfile +5 -3
  14. data/gemfiles/rails_5.1.gemfile +5 -3
  15. data/gemfiles/rails_5.2.gemfile +9 -0
  16. data/gemfiles/rails_6.0.gemfile +9 -0
  17. data/lib/dotiw.rb +33 -14
  18. data/lib/dotiw/action_view/helpers/date_helper.rb +32 -0
  19. data/lib/dotiw/locale/ar.yml +84 -26
  20. data/lib/dotiw/locale/da.yml +35 -0
  21. data/lib/dotiw/locale/de.yml +36 -1
  22. data/lib/dotiw/locale/en.yml +35 -0
  23. data/lib/dotiw/locale/es.yml +36 -1
  24. data/lib/dotiw/locale/fr.yml +35 -0
  25. data/lib/dotiw/locale/id.yml +35 -0
  26. data/lib/dotiw/locale/it.yml +35 -0
  27. data/lib/dotiw/locale/ja.yml +35 -0
  28. data/lib/dotiw/locale/ko.yml +23 -0
  29. data/lib/dotiw/locale/nb.yml +36 -1
  30. data/lib/dotiw/locale/nl.yml +35 -0
  31. data/lib/dotiw/locale/pl.yml +42 -0
  32. data/lib/dotiw/locale/pt-BR.yml +35 -0
  33. data/lib/dotiw/locale/ru.yml +37 -0
  34. data/lib/dotiw/locale/sv.yml +48 -0
  35. data/lib/dotiw/locale/vi.yml +48 -0
  36. data/lib/dotiw/locale/zh-CN.yml +23 -0
  37. data/lib/dotiw/locale/zh-TW.yml +60 -0
  38. data/lib/dotiw/methods.rb +108 -0
  39. data/lib/dotiw/time_hash.rb +52 -40
  40. data/lib/dotiw/version.rb +2 -2
  41. data/spec/lib/dotiw_spec.rb +304 -159
  42. data/spec/lib/i18n/ar.yml +2 -0
  43. data/spec/lib/i18n/da.yml +2 -0
  44. data/spec/lib/i18n/de.yml +2 -0
  45. data/spec/lib/i18n/en.yml +2 -0
  46. data/spec/lib/i18n/es.yml +3 -0
  47. data/spec/lib/i18n/fr.yml +2 -0
  48. data/spec/lib/i18n/id.yml +2 -0
  49. data/spec/lib/i18n/it.yml +3 -0
  50. data/spec/lib/i18n/ja.yml +2 -0
  51. data/spec/lib/i18n/ko.yml +2 -0
  52. data/spec/lib/i18n/nb.yml +2 -0
  53. data/spec/lib/i18n/nl.yml +2 -0
  54. data/spec/lib/i18n/pl.yml +2 -0
  55. data/spec/lib/i18n/pt-BR.yml +2 -0
  56. data/spec/lib/i18n/ru.yml +5 -0
  57. data/spec/lib/i18n/sv.yml +2 -0
  58. data/spec/lib/i18n/vi.yml +22 -0
  59. data/spec/lib/i18n/zh-CN.yml +2 -0
  60. data/spec/lib/i18n/zh-TW.yml +2 -0
  61. data/spec/spec_helper.rb +2 -9
  62. metadata +76 -30
  63. data/.travis.yml +0 -27
  64. data/lib/dotiw/action_view_ext/helpers/date_helper.rb +0 -103
@@ -23,3 +23,38 @@ en:
23
23
  one: 1 year
24
24
  other: "%{count} years"
25
25
  less_than_x: "less than %{distance}"
26
+ dotiw_compact:
27
+ seconds:
28
+ one: 1s
29
+ other: "%{count}s"
30
+ minutes:
31
+ one: 1m
32
+ other: "%{count}m"
33
+ hours:
34
+ one: 1h
35
+ other: "%{count}h"
36
+ days:
37
+ one: 1d
38
+ other: "%{count}d"
39
+ weeks:
40
+ one: 1w
41
+ other: "%{count}w"
42
+ months:
43
+ one: 1mo
44
+ other: "%{count}mo"
45
+ years:
46
+ one: 1y
47
+ other: "%{count}y"
48
+ less_than_x: "<%{distance}"
49
+ words_connector: ""
50
+ two_words_connector: ""
51
+ last_word_connector: ""
52
+ about_x_years:
53
+ one: ~1y
54
+ any: "~%{count}y"
55
+ over_x_years:
56
+ one: ">1y"
57
+ other: ">%{count}y"
58
+ almost_x_years:
59
+ one: ~1y
60
+ any: "~%{count}y"
@@ -22,4 +22,39 @@ es:
22
22
  years:
23
23
  one: un año
24
24
  other: "%{count} años"
25
- less_than_x: "menos de %{distance}"
25
+ less_than_x: "menos de %{distance}"
26
+ dotiw_compact:
27
+ seconds:
28
+ one: 1s
29
+ other: "%{count}s"
30
+ minutes:
31
+ one: 1m
32
+ other: "%{count}m"
33
+ hours:
34
+ one: 1h
35
+ other: "%{count}h"
36
+ days:
37
+ one: 1d
38
+ other: "%{count}d"
39
+ weeks:
40
+ one: 1s
41
+ other: "%{count}s"
42
+ months:
43
+ one: 1me
44
+ other: "%{count}me"
45
+ years:
46
+ one: 1a
47
+ other: "%{count}a"
48
+ less_than_x: "<%{distance}"
49
+ words_connector: ""
50
+ two_words_connector: ""
51
+ last_word_connector: ""
52
+ about_x_years:
53
+ one: ~1a
54
+ any: "~%{count}a"
55
+ over_x_years:
56
+ one: ">1a"
57
+ other: ">%{count}a"
58
+ almost_x_years:
59
+ one: ~1a
60
+ any: "~%{count}a"
@@ -23,3 +23,38 @@ fr:
23
23
  one: 1 an
24
24
  other: "%{count} ans"
25
25
  less_than_x: "moins de %{distance}"
26
+ dotiw_compact:
27
+ seconds:
28
+ one: 1s
29
+ other: "%{count}s"
30
+ minutes:
31
+ one: 1m
32
+ other: "%{count}m"
33
+ hours:
34
+ one: 1h
35
+ other: "%{count}h"
36
+ days:
37
+ one: 1j
38
+ other: "%{count}j"
39
+ weeks:
40
+ one: 1se
41
+ other: "%{count}se"
42
+ months:
43
+ one: 1mo
44
+ other: "%{count}mo"
45
+ years:
46
+ one: 1a
47
+ other: "%{count}a"
48
+ less_than_x: "<%{distance}"
49
+ words_connector: ""
50
+ two_words_connector: ""
51
+ last_word_connector: ""
52
+ about_x_years:
53
+ one: ~1a
54
+ any: "~%{count}a"
55
+ over_x_years:
56
+ one: ">1a"
57
+ other: ">%{count}a"
58
+ almost_x_years:
59
+ one: ~1a
60
+ any: "~%{count}a"
@@ -23,3 +23,38 @@ id:
23
23
  one: 1 tahun
24
24
  other: "%{count} tahun"
25
25
  less_than_x: "kurang dari %{distance}"
26
+ dotiw_compact:
27
+ seconds:
28
+ one: 1d
29
+ other: "%{count}d"
30
+ minutes:
31
+ one: 1m
32
+ other: "%{count}m"
33
+ hours:
34
+ one: 1j
35
+ other: "%{count}j"
36
+ days:
37
+ one: 1h
38
+ other: "%{count}h"
39
+ weeks:
40
+ one: 1mi
41
+ other: "%{count}mi"
42
+ months:
43
+ one: 1b
44
+ other: "%{count}b"
45
+ years:
46
+ one: 1t
47
+ other: "%{count}t"
48
+ less_than_x: "<%{distance}"
49
+ words_connector: ""
50
+ two_words_connector: ""
51
+ last_word_connector: ""
52
+ about_x_years:
53
+ one: ~1t
54
+ any: "~%{count}t"
55
+ over_x_years:
56
+ one: ">1t"
57
+ other: ">%{count}t"
58
+ almost_x_years:
59
+ one: ~1t
60
+ any: "~%{count}t"
@@ -22,3 +22,38 @@ it:
22
22
  years:
23
23
  one: un anno
24
24
  other: "%{count} anni"
25
+ dotiw_compact:
26
+ seconds:
27
+ one: 1s
28
+ other: "%{count}s"
29
+ minutes:
30
+ one: 1m
31
+ other: "%{count}m"
32
+ hours:
33
+ one: 1o
34
+ other: "%{count}o"
35
+ days:
36
+ one: 1g
37
+ other: "%{count}g"
38
+ weeks:
39
+ one: 1se
40
+ other: "%{count}se"
41
+ months:
42
+ one: 1me
43
+ other: "%{count}me"
44
+ years:
45
+ one: 1a
46
+ other: "%{count}a"
47
+ less_than_x: "<%{distance}"
48
+ words_connector: ""
49
+ two_words_connector: ""
50
+ last_word_connector: ""
51
+ about_x_years:
52
+ one: ~1a
53
+ any: "~%{count}a"
54
+ over_x_years:
55
+ one: ">1a"
56
+ other: ">%{count}a"
57
+ almost_x_years:
58
+ one: ~1a
59
+ any: "~%{count}a"
@@ -22,3 +22,38 @@ ja:
22
22
  years:
23
23
  one: "1年間"
24
24
  other: "%{count}年間"
25
+ dotiw_compact:
26
+ seconds:
27
+ one: "1秒"
28
+ other: "%{count}秒"
29
+ minutes:
30
+ one: "1分"
31
+ other: "%{count}分"
32
+ hours:
33
+ one: "1時間"
34
+ other: "%{count}時間"
35
+ days:
36
+ one: "1日間"
37
+ other: "%{count}日間"
38
+ weeks:
39
+ one: "1週間"
40
+ other: "%{count}週間"
41
+ months:
42
+ one: "1ヶ月"
43
+ other: "%{count}ヶ月"
44
+ years:
45
+ one: "1年間"
46
+ other: "%{count}年間"
47
+ less_than_x: "<%{distance}"
48
+ words_connector: ""
49
+ two_words_connector: ""
50
+ last_word_connector: ""
51
+ about_x_years:
52
+ one: ~1年間
53
+ any: "~%{count}年間"
54
+ over_x_years:
55
+ one: ">1年間"
56
+ other: ">%{count}年間"
57
+ almost_x_years:
58
+ one: ~1年間
59
+ any: "~%{count}年間"
@@ -23,3 +23,26 @@ ko:
23
23
  one: 일년
24
24
  other: "%{count} 년"
25
25
  less_than_x: "%{distance} 미만"
26
+ dotiw_compact:
27
+ seconds:
28
+ one: 일초
29
+ other: "%{count}초"
30
+ minutes:
31
+ one: 일분
32
+ other: "%{count}분"
33
+ hours:
34
+ one: 한시간
35
+ other: "%{count}시간"
36
+ days:
37
+ one: 하루
38
+ other: "%{count}일"
39
+ weeks:
40
+ one: 일주
41
+ other: "%{count}주"
42
+ months:
43
+ one: 한달
44
+ other: "%{count}달"
45
+ years:
46
+ one: 일년
47
+ other: "%{count}년"
48
+ less_than_x: "< %{distance}"
@@ -22,4 +22,39 @@ nb:
22
22
  years:
23
23
  one: 1 år
24
24
  other: "%{count} år"
25
- less_than_x: "mindre enn %{distance}"
25
+ less_than_x: "mindre enn %{distance}"
26
+ dotiw_compact:
27
+ seconds:
28
+ one: 1s
29
+ other: "%{count}s"
30
+ minutes:
31
+ one: 1m
32
+ other: "%{count}m"
33
+ hours:
34
+ one: 1t
35
+ other: "%{count}t"
36
+ days:
37
+ one: 1d
38
+ other: "%{count}d"
39
+ weeks:
40
+ one: 1u
41
+ other: "%{count}u"
42
+ months:
43
+ one: 1må
44
+ other: "%{count}må"
45
+ years:
46
+ one: 1å
47
+ other: "%{count}å"
48
+ less_than_x: "<%{distance}"
49
+ words_connector: ""
50
+ two_words_connector: ""
51
+ last_word_connector: ""
52
+ about_x_years:
53
+ one: ~1å
54
+ any: "~%{count}å"
55
+ over_x_years:
56
+ one: ">1å"
57
+ other: ">%{count}å"
58
+ almost_x_years:
59
+ one: ~1å
60
+ any: "~%{count}å"
@@ -23,3 +23,38 @@ nl:
23
23
  one: 1 jaar
24
24
  other: "%{count} jaar"
25
25
  less_than_x: "minder dan %{distance}"
26
+ dotiw_compact:
27
+ seconds:
28
+ one: 1s
29
+ other: "%{count}s"
30
+ minutes:
31
+ one: 1m
32
+ other: "%{count}m"
33
+ hours:
34
+ one: 1u
35
+ other: "%{count}u"
36
+ days:
37
+ one: 1d
38
+ other: "%{count}d"
39
+ weeks:
40
+ one: 1w
41
+ other: "%{count}w"
42
+ months:
43
+ one: 1ma
44
+ other: "%{count}ma"
45
+ years:
46
+ one: 1j
47
+ other: "%{count}j"
48
+ less_than_x: "<%{distance}"
49
+ words_connector: ""
50
+ two_words_connector: ""
51
+ last_word_connector: ""
52
+ about_x_years:
53
+ one: ~1j
54
+ any: "~%{count}j"
55
+ over_x_years:
56
+ one: ">1j"
57
+ other: ">%{count}j"
58
+ almost_x_years:
59
+ one: ~1j
60
+ any: "~%{count}j"
@@ -4,29 +4,71 @@ pl:
4
4
  seconds:
5
5
  one: "1 sekunda"
6
6
  few: "%{count} sekundy"
7
+ many: "%{count} sekund"
7
8
  other: "%{count} sekund"
8
9
  minutes:
9
10
  one: "1 minuta"
10
11
  few: "%{count} minuty"
12
+ many: "%{count} minut"
11
13
  other: "%{count} minut"
12
14
  hours:
13
15
  one: "1 godzina"
14
16
  few: "%{count} godziny"
17
+ many: "%{count} godzin"
15
18
  other: "%{count} godzin"
16
19
  days:
17
20
  one: "1 dzień"
18
21
  few: "%{count} dni"
22
+ many: "%{count} dni"
19
23
  other: "%{count} dni"
20
24
  weeks:
21
25
  one: "1 tydzień"
22
26
  few: "%{count} tygodnie"
27
+ many: "%{count} tygodni"
23
28
  other: "%{count} tygodni"
24
29
  months:
25
30
  one: "1 miesiąc"
26
31
  few: "%{count} miesiące"
32
+ many: "%{count} miesięcy"
27
33
  other: "%{count} miesięcy"
28
34
  years:
29
35
  one: "1 rok"
30
36
  few: "%{count} lata"
37
+ many: "%{count} lat"
31
38
  other: "%{count} lat"
32
39
  less_than_x: "mniej niż %{distance}"
40
+ dotiw_compact:
41
+ seconds:
42
+ one: 1s
43
+ other: "%{count}s"
44
+ minutes:
45
+ one: 1m
46
+ other: "%{count}m"
47
+ hours:
48
+ one: 1g
49
+ other: "%{count}g"
50
+ days:
51
+ one: 1d
52
+ other: "%{count}d"
53
+ weeks:
54
+ one: 1t
55
+ other: "%{count}t"
56
+ months:
57
+ one: 1mi
58
+ other: "%{count}mi"
59
+ years:
60
+ one: 1r
61
+ other: "%{count}l"
62
+ less_than_x: "<%{distance}"
63
+ words_connector: ""
64
+ two_words_connector: ""
65
+ last_word_connector: ""
66
+ about_x_years:
67
+ one: ~1r
68
+ any: "~%{count}r"
69
+ over_x_years:
70
+ one: ">1r"
71
+ other: ">%{count}r"
72
+ almost_x_years:
73
+ one: ~1r
74
+ any: "~%{count}r"
@@ -23,3 +23,38 @@ pt-BR:
23
23
  one: 1 ano
24
24
  other: "%{count} anos"
25
25
  less_than_x: "menos de %{distance}"
26
+ dotiw_compact:
27
+ seconds:
28
+ one: 1s
29
+ other: "%{count}s"
30
+ minutes:
31
+ one: 1m
32
+ other: "%{count}m"
33
+ hours:
34
+ one: 1h
35
+ other: "%{count}h"
36
+ days:
37
+ one: 1d
38
+ other: "%{count}d"
39
+ weeks:
40
+ one: 1s
41
+ other: "%{count}s"
42
+ months:
43
+ one: 1mê
44
+ other: "%{count}mê"
45
+ years:
46
+ one: 1a
47
+ other: "%{count}a"
48
+ less_than_x: "<%{distance}"
49
+ words_connector: ""
50
+ two_words_connector: ""
51
+ last_word_connector: ""
52
+ about_x_years:
53
+ one: ~1a
54
+ any: "~%{count}a"
55
+ over_x_years:
56
+ one: ">1a"
57
+ other: ">%{count}a"
58
+ almost_x_years:
59
+ one: ~1a
60
+ any: "~%{count}a"