timeago_js 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/assets/javascripts/timeago.js +258 -0
  3. data/assets/javascripts/timeago.locales.js +1 -0
  4. data/assets/javascripts/timeago/locales/ar.js +30 -0
  5. data/assets/javascripts/timeago/locales/be.js +55 -0
  6. data/assets/javascripts/timeago/locales/bg.js +18 -0
  7. data/assets/javascripts/timeago/locales/ca.js +18 -0
  8. data/assets/javascripts/timeago/locales/da.js +18 -0
  9. data/assets/javascripts/timeago/locales/de.js +18 -0
  10. data/assets/javascripts/timeago/locales/el.js +18 -0
  11. data/assets/javascripts/timeago/locales/en.js +18 -0
  12. data/assets/javascripts/timeago/locales/en_short.js +18 -0
  13. data/assets/javascripts/timeago/locales/es.js +18 -0
  14. data/assets/javascripts/timeago/locales/eu.js +18 -0
  15. data/assets/javascripts/timeago/locales/fi.js +18 -0
  16. data/assets/javascripts/timeago/locales/fr.js +18 -0
  17. data/assets/javascripts/timeago/locales/he.js +18 -0
  18. data/assets/javascripts/timeago/locales/hu.js +18 -0
  19. data/assets/javascripts/timeago/locales/in_BG.js +18 -0
  20. data/assets/javascripts/timeago/locales/in_HI.js +18 -0
  21. data/assets/javascripts/timeago/locales/in_ID.js +18 -0
  22. data/assets/javascripts/timeago/locales/it.js +18 -0
  23. data/assets/javascripts/timeago/locales/ja.js +18 -0
  24. data/assets/javascripts/timeago/locales/ko.js +18 -0
  25. data/assets/javascripts/timeago/locales/ml.js +18 -0
  26. data/assets/javascripts/timeago/locales/nb_NO.js +18 -0
  27. data/assets/javascripts/timeago/locales/nl.js +18 -0
  28. data/assets/javascripts/timeago/locales/nn_NO.js +18 -0
  29. data/assets/javascripts/timeago/locales/pl.js +38 -0
  30. data/assets/javascripts/timeago/locales/pt_BR.js +18 -0
  31. data/assets/javascripts/timeago/locales/ro.js +29 -0
  32. data/assets/javascripts/timeago/locales/ru.js +55 -0
  33. data/assets/javascripts/timeago/locales/sv.js +18 -0
  34. data/assets/javascripts/timeago/locales/ta.js +18 -0
  35. data/assets/javascripts/timeago/locales/th.js +18 -0
  36. data/assets/javascripts/timeago/locales/tr.js +18 -0
  37. data/assets/javascripts/timeago/locales/uk.js +44 -0
  38. data/assets/javascripts/timeago/locales/vi.js +18 -0
  39. data/assets/javascripts/timeago/locales/zh_CN.js +18 -0
  40. data/assets/javascripts/timeago/locales/zh_TW.js +18 -0
  41. data/lib/timeago_js.rb +4 -0
  42. data/lib/timeago_js/engine.rb +9 -0
  43. data/lib/timeago_js/version.rb +5 -0
  44. metadata +142 -0
@@ -0,0 +1,18 @@
1
+ this.timeago.register('sv', function(number, index) {
2
+ return [
3
+ ['just nu', 'om en stund'],
4
+ ['%s sekunder sedan', 'om %s seconder'],
5
+ ['1 minut sedan', 'om 1 minut'],
6
+ ['%s minuter sedan', 'om %s minuter'],
7
+ ['1 timme sedan', 'om 1 timme'],
8
+ ['%s timmar sedan', 'om %s timmar'],
9
+ ['1 dag sedan', 'om 1 dag'],
10
+ ['%s dagar sedan', 'om %s dagar'],
11
+ ['1 vecka sedan', 'om 1 vecka'],
12
+ ['%s veckor sedan', 'om %s veckor'],
13
+ ['1 månad sedan', 'om 1 månad'],
14
+ ['%s månader sedan', 'om %s månader'],
15
+ ['1 år sedan', 'om 1 år'],
16
+ ['%s år sedan', 'om %s år']
17
+ ][index];
18
+ })
@@ -0,0 +1,18 @@
1
+ this.timeago.register('ta', function(number, index) {
2
+ return [
3
+ ['இப்போது', 'சற்று நேரம் முன்பு'],
4
+ ['%s நொடிக்கு முன்', '%s நொடிகளில்'],
5
+ ['1 நிமிடத்திற்க்கு முன்', '1 நிமிடத்தில்'],
6
+ ['%s நிமிடத்திற்க்கு முன்', '%s நிமிடங்களில்'],
7
+ ['1 மணி நேரத்திற்கு முன்', '1 மணி நேரத்திற்குள்'],
8
+ ['%s மணி நேரத்திற்கு முன்', '%s மணி நேரத்திற்குள்'],
9
+ ['1 நாளுக்கு முன்', '1 நாளில்'],
10
+ ['%s நாட்களுக்கு முன்', '%s நாட்களில்'],
11
+ ['1 வாரத்திற்கு முன்', '1 வாரத்தில்'],
12
+ ['%s வாரங்களுக்கு முன்', '%s வாரங்களில்'],
13
+ ['1 மாதத்திற்கு முன்', '1 மாதத்தில்'],
14
+ ['%s மாதங்களுக்கு முன்', '%s மாதங்களில்'],
15
+ ['1 வருடத்திற்கு முன்', '1 வருடத்தில்'],
16
+ ['%s வருடங்களுக்கு முன்', '%s வருடங்களில்']
17
+ ][index];
18
+ })
@@ -0,0 +1,18 @@
1
+ this.timeago.register('th', function(number, index) {
2
+ return [
3
+ ['เมื่อสักครู่นี้', 'อีกสักครู่'],
4
+ ['%s วินาทีที่แล้ว', 'ใน %s วินาที'],
5
+ ['1 นาทีที่แล้ว', 'ใน 1 นาที'],
6
+ ['%s นาทีที่แล้ว', 'ใน %s นาที'],
7
+ ['1 ชั่วโมงที่แล้ว', 'ใน 1 ชั่วโมง'],
8
+ ['%s ชั่วโมงที่แล้ว', 'ใน %s ชั่วโมง'],
9
+ ['1 วันที่แล้ว', 'ใน 1 วัน'],
10
+ ['%s วันที่แล้ว', 'ใน %s วัน'],
11
+ ['1 อาทิตย์ที่แล้ว', 'ใน 1 อาทิตย์'],
12
+ ['%s อาทิตย์ที่แล้ว', 'ใน %s อาทิตย์'],
13
+ ['1 เดือนที่แล้ว', 'ใน 1 เดือน'],
14
+ ['%s เดือนที่แล้ว', 'ใน %s เดือน'],
15
+ ['1 ปีที่แล้ว', 'ใน 1 ปี'],
16
+ ['%s ปีที่แล้ว', 'ใน %s ปี']
17
+ ][index];
18
+ })
@@ -0,0 +1,18 @@
1
+ this.timeago.register('tr', function(number, index) {
2
+ return [
3
+ ['az önce', 'şimdi'],
4
+ ['%s saniye önce', '%s saniye içinde'],
5
+ ['1 dakika önce', '1 dakika içinde'],
6
+ ['%s dakika önce', '%s dakika içinde'],
7
+ ['1 saat önce', '1 saat içinde'],
8
+ ['%s saat önce', '%s saat içinde'],
9
+ ['1 gün önce', '1 gün içinde'],
10
+ ['%s gün önce', '%s gün içinde'],
11
+ ['1 hafta önce', '1 hafta içinde'],
12
+ ['%s hafta önce', '%s hafta içinde'],
13
+ ['1 ay önce', '1 ay içinde'],
14
+ ['%s ay önce', '%s ay içinde'],
15
+ ['1 yıl önce', '1 yıl içinde'],
16
+ ['%s yıl önce', '%s yıl içinde']
17
+ ][index];
18
+ })
@@ -0,0 +1,44 @@
1
+ (function() {
2
+ var seconds = formatNum.bind(null, 'секунду', '%s секунду', '%s секунди', '%s секунд'),
3
+ minutes = formatNum.bind(null, 'хвилину', '%s хвилину', '%s хвилини', '%s хвилин'),
4
+ hours = formatNum.bind(null, 'годину', '%s годину', '%s години', '%s годин'),
5
+ days = formatNum.bind(null, 'день', '%s день', '%s дні', '%s днів'),
6
+ weeks = formatNum.bind(null, 'тиждень', '%s тиждень', '%s тиждні', '%s тижднів'),
7
+ months = formatNum.bind(null, 'місяць', '%s місяць', '%s місяці', '%s місяців'),
8
+ years = formatNum.bind(null, 'рік', '%s рік', '%s роки', '%s років')
9
+
10
+ var _fn = function (number, index) {
11
+ switch (index) {
12
+ case 0: return ['щойно', 'через декілька секунд']
13
+ case 1: return [seconds(number) + ' тому', 'через ' + seconds(number)]
14
+ case 2:
15
+ case 3: return [minutes(number) + ' тому', 'через ' + minutes(number)]
16
+ case 4:
17
+ case 5: return [hours(number) + ' тому', 'через ' + hours(number)]
18
+ case 6:
19
+ case 7: return [days(number) + ' тому', 'через ' + days(number)]
20
+ case 8:
21
+ case 9: return [weeks(number) + ' тому', 'через ' + weeks(number)]
22
+ case 10:
23
+ case 11: return [months(number) + ' тому', 'через ' + months(number)]
24
+ case 12:
25
+ case 13: return [years(number) + ' тому', 'через ' + years(number)]
26
+ default: return ['', '']
27
+ }
28
+ }
29
+
30
+ function formatNum(f1, f, s, t, n) {
31
+ var n10 = n % 10,
32
+ str = t
33
+
34
+ if (n === 1) {
35
+ str = f1
36
+ } else if (n10 === 1 && n > 20) {
37
+ str = f
38
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
39
+ str = s
40
+ }
41
+ return str
42
+ }
43
+ this.timeago.register('uk', _fn)
44
+ })();
@@ -0,0 +1,18 @@
1
+ this.timeago.register('vi', function(number, index) {
2
+ return [
3
+ ['vừa xong', 'một lúc'],
4
+ ['%s giây trước', 'trong %s giây'],
5
+ ['1 phút trước', 'trong 1 phút'],
6
+ ['%s phút trước', 'trong %s phút'],
7
+ ['1 giờ trước', 'trong 1 giờ'],
8
+ ['%s giờ trước', 'trong %s giờ'],
9
+ ['1 ngày trước', 'trong 1 ngày'],
10
+ ['%s ngày trước', 'trong %s ngày'],
11
+ ['1 tuần trước', 'trong 1 tuần'],
12
+ ['%s tuần trước', 'trong %s tuần'],
13
+ ['1 tháng trước', 'trong 1 tháng'],
14
+ ['%s tháng trước', 'trong %s tháng'],
15
+ ['1 năm trước', 'trong 1 năm'],
16
+ ['%s năm trước', 'trong %s năm']
17
+ ][index];
18
+ })
@@ -0,0 +1,18 @@
1
+ this.timeago.register('zh_CN', function(number, index) {
2
+ return [
3
+ ['刚刚', '片刻后'],
4
+ ['%s秒前', '%s秒后'],
5
+ ['1分钟前', '1分钟后'],
6
+ ['%s分钟前', '%s分钟后'],
7
+ ['1小时前', '1小时后'],
8
+ ['%s小时前', '%s小时后'],
9
+ ['1天前', '1天后'],
10
+ ['%s天前', '%s天后'],
11
+ ['1周前', '1周后'],
12
+ ['%s周前', '%s周后'],
13
+ ['1月前', '1月后'],
14
+ ['%s月前', '%s月后'],
15
+ ['1年前', '1年后'],
16
+ ['%s年前', '%s年后']
17
+ ][index];
18
+ })
@@ -0,0 +1,18 @@
1
+ this.timeago.register('zh_TW', function(number, index) {
2
+ return [
3
+ ['剛剛', '片刻後'],
4
+ ['%s秒前', '%s秒後'],
5
+ ['1分鐘前', '1分鐘後'],
6
+ ['%s分鐘前', '%s分鐘後'],
7
+ ['1小時前', '1小時後'],
8
+ ['%s小時前', '%s小時後'],
9
+ ['1天前', '1天後'],
10
+ ['%s天前', '%s天後'],
11
+ ['1周前', '1周後'],
12
+ ['%s周前', '%s周後'],
13
+ ['1月前', '1月後'],
14
+ ['%s月前', '%s月後'],
15
+ ['1年前', '1年後'],
16
+ ['%s年前', '%s年後']
17
+ ][index];
18
+ })
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'timeago_js/version'
4
+ require 'timeago_js/engine' if defined?(Rails)
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TimeagoJs
4
+ class Engine < ::Rails::Engine
5
+ initializer 'timeago_js.assets' do |app|
6
+ app.config.assets.paths << root.join('assets', 'javascripts').to_s
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TimeagoJs
4
+ VERSION = '3.0.1'
5
+ end
metadata ADDED
@@ -0,0 +1,142 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: timeago_js
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Gleb Mazovetskiy
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-05-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Works with Rails out of the box.
70
+ email:
71
+ - glex.spb@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - assets/javascripts/timeago.js
77
+ - assets/javascripts/timeago.locales.js
78
+ - assets/javascripts/timeago/locales/ar.js
79
+ - assets/javascripts/timeago/locales/be.js
80
+ - assets/javascripts/timeago/locales/bg.js
81
+ - assets/javascripts/timeago/locales/ca.js
82
+ - assets/javascripts/timeago/locales/da.js
83
+ - assets/javascripts/timeago/locales/de.js
84
+ - assets/javascripts/timeago/locales/el.js
85
+ - assets/javascripts/timeago/locales/en.js
86
+ - assets/javascripts/timeago/locales/en_short.js
87
+ - assets/javascripts/timeago/locales/es.js
88
+ - assets/javascripts/timeago/locales/eu.js
89
+ - assets/javascripts/timeago/locales/fi.js
90
+ - assets/javascripts/timeago/locales/fr.js
91
+ - assets/javascripts/timeago/locales/he.js
92
+ - assets/javascripts/timeago/locales/hu.js
93
+ - assets/javascripts/timeago/locales/in_BG.js
94
+ - assets/javascripts/timeago/locales/in_HI.js
95
+ - assets/javascripts/timeago/locales/in_ID.js
96
+ - assets/javascripts/timeago/locales/it.js
97
+ - assets/javascripts/timeago/locales/ja.js
98
+ - assets/javascripts/timeago/locales/ko.js
99
+ - assets/javascripts/timeago/locales/ml.js
100
+ - assets/javascripts/timeago/locales/nb_NO.js
101
+ - assets/javascripts/timeago/locales/nl.js
102
+ - assets/javascripts/timeago/locales/nn_NO.js
103
+ - assets/javascripts/timeago/locales/pl.js
104
+ - assets/javascripts/timeago/locales/pt_BR.js
105
+ - assets/javascripts/timeago/locales/ro.js
106
+ - assets/javascripts/timeago/locales/ru.js
107
+ - assets/javascripts/timeago/locales/sv.js
108
+ - assets/javascripts/timeago/locales/ta.js
109
+ - assets/javascripts/timeago/locales/th.js
110
+ - assets/javascripts/timeago/locales/tr.js
111
+ - assets/javascripts/timeago/locales/uk.js
112
+ - assets/javascripts/timeago/locales/vi.js
113
+ - assets/javascripts/timeago/locales/zh_CN.js
114
+ - assets/javascripts/timeago/locales/zh_TW.js
115
+ - lib/timeago_js.rb
116
+ - lib/timeago_js/engine.rb
117
+ - lib/timeago_js/version.rb
118
+ homepage: https://github.com/glebm/timeago_js-rubygem
119
+ licenses:
120
+ - MIT
121
+ metadata: {}
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubyforge_project:
138
+ rubygems_version: 2.6.12
139
+ signing_key:
140
+ specification_version: 4
141
+ summary: Timeago.js assets as a Ruby gem. http://timeago.org/
142
+ test_files: []