rails-timeago 2.5.1 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -18
  3. data/lib/assets/javascripts/rails-timeago-all.js +32 -30
  4. data/lib/rails-timeago/version.rb +2 -2
  5. data/vendor/assets/javascripts/jquery.timeago.js +18 -3
  6. data/vendor/assets/javascripts/locales/jquery.timeago.ar.js +90 -26
  7. data/vendor/assets/javascripts/locales/jquery.timeago.bg.js +1 -1
  8. data/vendor/assets/javascripts/locales/jquery.timeago.bs.js +1 -1
  9. data/vendor/assets/javascripts/locales/jquery.timeago.ca.js +1 -1
  10. data/vendor/assets/javascripts/locales/jquery.timeago.cz.js +1 -1
  11. data/vendor/assets/javascripts/locales/jquery.timeago.da.js +1 -1
  12. data/vendor/assets/javascripts/locales/jquery.timeago.de.js +1 -1
  13. data/vendor/assets/javascripts/locales/jquery.timeago.el.js +1 -1
  14. data/vendor/assets/javascripts/locales/jquery.timeago.es.js +1 -1
  15. data/vendor/assets/javascripts/locales/jquery.timeago.et.js +18 -0
  16. data/vendor/assets/javascripts/locales/jquery.timeago.fa.js +1 -1
  17. data/vendor/assets/javascripts/locales/jquery.timeago.fi.js +1 -1
  18. data/vendor/assets/javascripts/locales/jquery.timeago.fr-short.js +1 -1
  19. data/vendor/assets/javascripts/locales/jquery.timeago.fr.js +1 -1
  20. data/vendor/assets/javascripts/locales/jquery.timeago.he.js +1 -1
  21. data/vendor/assets/javascripts/locales/jquery.timeago.hr.js +1 -1
  22. data/vendor/assets/javascripts/locales/jquery.timeago.hu.js +1 -1
  23. data/vendor/assets/javascripts/locales/jquery.timeago.hy.js +1 -1
  24. data/vendor/assets/javascripts/locales/jquery.timeago.id.js +2 -2
  25. data/vendor/assets/javascripts/locales/jquery.timeago.it.js +1 -1
  26. data/vendor/assets/javascripts/locales/jquery.timeago.ko.js +1 -1
  27. data/vendor/assets/javascripts/locales/jquery.timeago.no.js +1 -1
  28. data/vendor/assets/javascripts/locales/jquery.timeago.pl.js +1 -1
  29. data/vendor/assets/javascripts/locales/jquery.timeago.pt.js +1 -1
  30. data/vendor/assets/javascripts/locales/jquery.timeago.ro.js +1 -1
  31. data/vendor/assets/javascripts/locales/jquery.timeago.rs.js +49 -0
  32. data/vendor/assets/javascripts/locales/jquery.timeago.ru.js +1 -1
  33. data/vendor/assets/javascripts/locales/jquery.timeago.sv.js +1 -1
  34. data/vendor/assets/javascripts/locales/jquery.timeago.tr.js +1 -1
  35. data/vendor/assets/javascripts/locales/jquery.timeago.uk.js +1 -1
  36. data/vendor/assets/javascripts/locales/jquery.timeago.zh-CN.js +1 -1
  37. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b07838ee4cbfc371e9d1d1d623184c109023651
4
- data.tar.gz: 5a0e0b5702d4e8b3cd9ef1f1dac72cdfcc7b22cb
3
+ metadata.gz: 3c18525f788e1b2c214f2f22bad4f42387e3e482
4
+ data.tar.gz: 7dee8a7b561b227182d58fe64f03b68f224b88af
5
5
  SHA512:
6
- metadata.gz: 2efad99f1bf0d51b3b00682007147dcf3e66c7158e1eecef34040c0b021ca024a467ea6c58be3fb4c424cca3de1eb460b0f29cb03b09d735a1ebf13425f4b6f6
7
- data.tar.gz: 4d419208df4e3af20327f4dc1408fe0c2813ae748d519fe3c3b7c1a91ce795561ddc9980531d0da71504320e6777665ea3787af5ccca8a459cd19e3a1a4b9713
6
+ metadata.gz: 78ec84aa51169d4abb5893ca039b4c428d63c68c349d1c8ee1a3e1d0b1a94b2372ec6d322071a5c8992c669ebe85ebdbf532775113764b4f7835dfdc0bdb50e1
7
+ data.tar.gz: ce95de33570f57060b947cb2bedc3577696bf3c028a2fb5778cfed4afc1bf206ae853b53f02d50779b7fd0430aed98d5a787b6f6437b05eb1aacda2371cdf868
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## Installation
7
7
 
8
- Add this line to your application's Gemfile:
8
+ Add this line to your application's `Gemfile`:
9
9
 
10
10
  ```ruby
11
11
  gem 'rails-timeago', '~> 2.0'
@@ -19,7 +19,7 @@ Or install it yourself as:
19
19
 
20
20
  $ gem install rails-timeago
21
21
 
22
- To use bundled jQuery Timeago plugin add this require statement to your application.js file:
22
+ To use bundled jQuery Timeago plugin add this require statement to your `application.js` file:
23
23
 
24
24
  //= require rails-timeago
25
25
 
@@ -27,7 +27,7 @@ This will also convert all matching time tags on page load.
27
27
 
28
28
  Use the following to also include all available locale files:
29
29
 
30
- //= require rails-timeago-all
30
+ //= require rails-timeago-all
31
31
 
32
32
  ## Usage
33
33
 
@@ -42,27 +42,27 @@ Use the timeago_tag helper like any other regular tag helper:
42
42
 
43
43
  **nojs**
44
44
  Add time ago in words as time tag content instead of absolute time.
45
- (default: false)
45
+ (default: `false`)
46
46
 
47
47
  **date_only**
48
48
  Only print date as tag content instead of full time.
49
- (default: true)
49
+ (default: `true`)
50
50
 
51
51
  **format**
52
52
  A time format for localize method used to format static time.
53
- (default: default)
53
+ (default: `default`)
54
54
 
55
55
  **limit**
56
56
  Set a limit for time ago tags. All dates before given limit will not be converted.
57
- (default: 4.days.ago)
57
+ (default: `4.days.ago`)
58
58
 
59
59
  **force**
60
60
  Force time ago tag ignoring limit option.
61
- (default: false)
61
+ (default: `false`)
62
62
 
63
63
  **default**
64
- String that will be returned if time is nil.
65
- (default: '-')
64
+ String that will be returned if time is `nil`.
65
+ (default: `'-'`)
66
66
 
67
67
  **title**
68
68
  A string or block that will be used to create a title attribute for timeago tags. It set to nil or false no title attribute will be set.
@@ -75,7 +75,7 @@ The above options can be assigned globally as defaults using
75
75
  Rails::Timeago.default_options :limit => proc { 20.days.ago }, :nojs => true
76
76
  ```
77
77
 
78
- A global limit should always be given as a block that will be evaluated each time the rails timeago_tag helper is called. That avoids the limit becoming smaller the longer the application runs.
78
+ A global limit should always be given as a block that will be evaluated each time the rails `timeago_tag` helper is called. That avoids the limit becoming smaller the longer the application runs.
79
79
 
80
80
  ## I18n
81
81
 
@@ -87,16 +87,22 @@ A global limit should always be given as a block that will be evaluated each tim
87
87
 
88
88
  The following snippet will print a script tag that set the jQuery timeago locale according to your `I18n.locale`:
89
89
 
90
- ```ruby
90
+ ```erb
91
91
  <%= timeago_script_tag %>
92
92
  ```
93
93
 
94
- Just insert it in your application layout's html head. If you use another I18n framework for JavaScript you can also directly set `jQuery.timeago.settings.lang`.
94
+ Just insert it in your application layout's html head. If you use another I18n framework for JavaScript you can also directly set `jQuery.timeago.settings.lang`. For example:
95
+
96
+ ```js
97
+ jQuery.timeago.settings.lang = $('html').attr('lang')
98
+ ````
95
99
 
96
100
  Do not forget to require the needed locale files by either require `rails-timeago-all` in your `application.js` file or require specific locale files:
97
101
 
98
- //= require locales/jquery.timeago.de.js
99
- //= require locales/jquery.timeago.ru.js
102
+ ```js
103
+ //= require locales/jquery.timeago.de.js
104
+ //= require locales/jquery.timeago.ru.js
105
+ ```
100
106
 
101
107
  *Note:* English is included in jQuery timeago library, but can be easily override by include an own file that defines `jQuery.timeago.settings.strings["en"]`. See a locale file for more details.
102
108
 
@@ -106,9 +112,11 @@ Do not forget to require the needed locale files by either require `rails-timeag
106
112
 
107
113
  Your customized jQuery locale files must be changed to work with **rails-timeago 2**. Instead of defining your locale strings as `jQuery.timeago.settings.strings` you need to define them like this:
108
114
 
109
- jQuery.timeago.settings.strings["en"] = {
110
- ...
111
- }
115
+ ```js
116
+ jQuery.timeago.settings.strings["en"] = {
117
+ ...
118
+ }
119
+ ```
112
120
 
113
121
  ## License
114
122
 
@@ -1,43 +1,45 @@
1
1
  // Rails timeago bootstrap with all locales
2
2
  //= require rails-timeago
3
- //= require locales/jquery.timeago.de.js
4
- //= require locales/jquery.timeago.cy.js
5
- //= require locales/jquery.timeago.pl.js
6
- //= require locales/jquery.timeago.mk.js
7
- //= require locales/jquery.timeago.zh-CN.js
3
+ //= require locales/jquery.timeago.ar.js
4
+ //= require locales/jquery.timeago.bg.js
8
5
  //= require locales/jquery.timeago.bs.js
9
- //= require locales/jquery.timeago.en-short.js
10
- //= require locales/jquery.timeago.it.js
11
- //= require locales/jquery.timeago.fi.js
12
- //= require locales/jquery.timeago.es.js
13
- //= require locales/jquery.timeago.uk.js
14
- //= require locales/jquery.timeago.lt.js
15
- //= require locales/jquery.timeago.zh-TW.js
16
- //= require locales/jquery.timeago.sk.js
17
- //= require locales/jquery.timeago.hy.js
18
6
  //= require locales/jquery.timeago.ca.js
19
- //= require locales/jquery.timeago.pt.js
7
+ //= require locales/jquery.timeago.cy.js
8
+ //= require locales/jquery.timeago.cz.js
9
+ //= require locales/jquery.timeago.da.js
10
+ //= require locales/jquery.timeago.de.js
20
11
  //= require locales/jquery.timeago.el.js
21
- //= require locales/jquery.timeago.sv.js
22
- //= require locales/jquery.timeago.ar.js
23
- //= require locales/jquery.timeago.no.js
12
+ //= require locales/jquery.timeago.en-short.js
13
+ //= require locales/jquery.timeago.es.js
14
+ //= require locales/jquery.timeago.et.js
24
15
  //= require locales/jquery.timeago.fa.js
16
+ //= require locales/jquery.timeago.fi.js
17
+ //= require locales/jquery.timeago.fr-short.js
25
18
  //= require locales/jquery.timeago.fr.js
26
- //= require locales/jquery.timeago.pt-br.js
27
- //= require locales/jquery.timeago.tr.js
28
19
  //= require locales/jquery.timeago.he.js
29
- //= require locales/jquery.timeago.bg.js
30
- //= require locales/jquery.timeago.ko.js
31
- //= require locales/jquery.timeago.uz.js
32
- //= require locales/jquery.timeago.cz.js
33
- //= require locales/jquery.timeago.sl.js
20
+ //= require locales/jquery.timeago.hr.js
34
21
  //= require locales/jquery.timeago.hu.js
22
+ //= require locales/jquery.timeago.hy.js
35
23
  //= require locales/jquery.timeago.id.js
36
- //= require locales/jquery.timeago.hr.js
37
- //= require locales/jquery.timeago.ru.js
38
- //= require locales/jquery.timeago.nl.js
39
- //= require locales/jquery.timeago.fr-short.js
40
- //= require locales/jquery.timeago.da.js
24
+ //= require locales/jquery.timeago.it.js
41
25
  //= require locales/jquery.timeago.ja.js
26
+ //= require locales/jquery.timeago.ko.js
27
+ //= require locales/jquery.timeago.lt.js
28
+ //= require locales/jquery.timeago.mk.js
29
+ //= require locales/jquery.timeago.nl.js
30
+ //= require locales/jquery.timeago.no.js
31
+ //= require locales/jquery.timeago.pl.js
32
+ //= require locales/jquery.timeago.pt-br.js
33
+ //= require locales/jquery.timeago.pt.js
42
34
  //= require locales/jquery.timeago.ro.js
35
+ //= require locales/jquery.timeago.rs.js
36
+ //= require locales/jquery.timeago.ru.js
37
+ //= require locales/jquery.timeago.sk.js
38
+ //= require locales/jquery.timeago.sl.js
39
+ //= require locales/jquery.timeago.sv.js
43
40
  //= require locales/jquery.timeago.th.js
41
+ //= require locales/jquery.timeago.tr.js
42
+ //= require locales/jquery.timeago.uk.js
43
+ //= require locales/jquery.timeago.uz.js
44
+ //= require locales/jquery.timeago.zh-CN.js
45
+ //= require locales/jquery.timeago.zh-TW.js
@@ -2,8 +2,8 @@ module Rails
2
2
  module Timeago
3
3
  module VERSION
4
4
  MAJOR = 2
5
- MINOR = 5
6
- PATCH = 1
5
+ MINOR = 6
6
+ PATCH = 0
7
7
  STAGE = nil
8
8
 
9
9
  def self.to_s
@@ -3,7 +3,7 @@
3
3
  * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
4
4
  *
5
5
  * @name timeago
6
- * @version 1.1.0
6
+ * @version 1.3.0
7
7
  * @requires jQuery v1.2.3+
8
8
  * @author Ryan McGeary
9
9
  * @license MIT License - http://www.opensource.org/licenses/mit-license.php
@@ -41,6 +41,7 @@
41
41
  refreshMillis: 60000,
42
42
  allowFuture: false,
43
43
  localeTitle: false,
44
+ cutoff: 0,
44
45
  lang: "en",
45
46
  strings: { "en": {
46
47
  prefixAgo: null,
@@ -128,12 +129,22 @@
128
129
  refresh_el();
129
130
  var $s = $t.settings;
130
131
  if ($s.refreshMillis > 0) {
131
- setInterval(refresh_el, $s.refreshMillis);
132
+ this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
132
133
  }
133
134
  },
134
135
  update: function(time){
135
136
  $(this).data('timeago', { datetime: $t.parse(time) });
136
137
  refresh.apply(this);
138
+ },
139
+ updateFromDOM: function(){
140
+ $(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) });
141
+ refresh.apply(this);
142
+ },
143
+ dispose: function () {
144
+ if (this._timeagoInterval) {
145
+ window.clearInterval(this._timeagoInterval);
146
+ this._timeagoInterval = null;
147
+ }
137
148
  }
138
149
  };
139
150
 
@@ -151,8 +162,12 @@
151
162
 
152
163
  function refresh() {
153
164
  var data = prepareData(this);
165
+ var $s = $t.settings;
166
+
154
167
  if (!isNaN(data.datetime)) {
155
- $(this).text(inWords(data.datetime, ($(this).attr('lang')) ? $(this).attr('lang') : $t.settings.lang));
168
+ if ( $s.cutoff == 0 || distance(data.datetime) < $s.cutoff) {
169
+ $(this).text(inWords(data.datetime, ($(this).attr('lang')) ? $(this).attr('lang') : $t.settings.lang));
170
+ }
156
171
  }
157
172
  return this;
158
173
  }
@@ -1,32 +1,96 @@
1
- // Language: Arabic
2
- // Translated By Khaled Attia < Khal3d.com >
3
1
  (function() {
4
- function numpf(num, w, x, y, z) {
5
- if( num == 0 ) {
6
- return w;
7
- } else if( num == 2 ) {
8
- return x;
9
- } else if( num >= 3 && num <= 10) {
10
- return y; // 3:10
11
- } else {
12
- return z; // 11+
13
- }
2
+ function numpf(n, a) {
3
+ return a[plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5];
14
4
  }
15
- jQuery.timeago.settings.strings["ar"] = {
5
+
6
+ jQuery.timeago.settings.strings["ar"] = {
16
7
  prefixAgo: "منذ",
17
- prefixFromNow: "يتبقى",
8
+ prefixFromNow: "بعد",
18
9
  suffixAgo: null,
19
10
  suffixFromNow: null, // null OR "من الآن"
20
- seconds: function(value) { return numpf(value, "لحظات", "ثانيتين", "%d ثواني", "%d ثانيه"); },
21
- minute: "دقيقة",
22
- minutes: function(value) { return numpf(value, null, "دقيقتين", "%d دقائق", "%d دقيقة"); },
23
- hour: "ساعة",
24
- hours: function(value) { return numpf(value, null, "ساعتين", "%d ساعات", "%d ساعة"); },
25
- day: "يوم",
26
- days: function(value) { return numpf(value, null, "يومين", "%d أيام", "%d يوم"); },
27
- month: "شهر",
28
- months: function(value) { return numpf(value, null, "شهرين", "%d أشهر", "%d شهر"); },
29
- year: "سنه",
30
- years: function(value) { return numpf(value, null, "سنتين", "%d سنوات", "%d سنه"); }
11
+ second: function(value) { return numpf(value, [
12
+ 'أقل من ثانية',
13
+ 'ثانية واحدة',
14
+ 'ثانيتين',
15
+ '%d ثوانٍ',
16
+ '%d ثانية',
17
+ '%d ثانية']); },
18
+ seconds: function(value) { return numpf(value, [
19
+ 'أقل من ثانية',
20
+ 'ثانية واحدة',
21
+ 'ثانيتين',
22
+ '%d ثوانٍ',
23
+ '%d ثانية',
24
+ '%d ثانية']); },
25
+ minute: function(value) { return numpf(value, [
26
+ 'أقل من دقيقة',
27
+ 'دقيقة واحدة',
28
+ 'دقيقتين',
29
+ '%d دقائق',
30
+ '%d دقيقة',
31
+ 'دقيقة']); },
32
+ minutes: function(value) { return numpf(value, [
33
+ 'أقل من دقيقة',
34
+ 'دقيقة واحدة',
35
+ 'دقيقتين',
36
+ '%d دقائق',
37
+ '%d دقيقة',
38
+ 'دقيقة']); },
39
+ hour: function(value) { return numpf(value, [
40
+ 'أقل من ساعة',
41
+ 'ساعة واحدة',
42
+ 'ساعتين',
43
+ '%d ساعات',
44
+ '%d ساعة',
45
+ '%d ساعة']); },
46
+ hours: function(value) { return numpf(value, [
47
+ 'أقل من ساعة',
48
+ 'ساعة واحدة',
49
+ 'ساعتين',
50
+ '%d ساعات',
51
+ '%d ساعة',
52
+ '%d ساعة']); },
53
+ day: function(value) { return numpf(value, [
54
+ 'أقل من يوم',
55
+ 'يوم واحد',
56
+ 'يومين',
57
+ '%d أيام',
58
+ '%d يومًا',
59
+ '%d يوم']); },
60
+ days: function(value) { return numpf(value, [
61
+ 'أقل من يوم',
62
+ 'يوم واحد',
63
+ 'يومين',
64
+ '%d أيام',
65
+ '%d يومًا',
66
+ '%d يوم']); },
67
+ month: function(value) { return numpf(value, [
68
+ 'أقل من شهر',
69
+ 'شهر واحد',
70
+ 'شهرين',
71
+ '%d أشهر',
72
+ '%d شهرًا',
73
+ '%d شهر']); },
74
+ months: function(value) { return numpf(value, [
75
+ 'أقل من شهر',
76
+ 'شهر واحد',
77
+ 'شهرين',
78
+ '%d أشهر',
79
+ '%d شهرًا',
80
+ '%d شهر']); },
81
+ year: function(value) { return numpf(value, [
82
+ 'أقل من عام',
83
+ 'عام واحد',
84
+ '%d عامين',
85
+ '%d أعوام',
86
+ '%d عامًا']);
87
+ },
88
+ years: function(value) { return numpf(value, [
89
+ 'أقل من عام',
90
+ 'عام واحد',
91
+ 'عامين',
92
+ '%d أعوام',
93
+ '%d عامًا',
94
+ '%d عام']);}
31
95
  };
32
- })();
96
+ })();
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["bg"] = {
15
15
  months: "%d месеца",
16
16
  year: "една година",
17
17
  years: "%d години"
18
- };
18
+ };
@@ -46,4 +46,4 @@
46
46
  wordSeparator: " "
47
47
  };
48
48
 
49
- }).call(this);
49
+ }).call(this);
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["ca"] = {
15
15
  months: "%d mesos",
16
16
  year: "aproximadament un any",
17
17
  years: "%d anys"
18
- };
18
+ };
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["cz"] = {
15
15
  months: "%d měsíci",
16
16
  year: "1 rokem",
17
17
  years: "%d roky"
18
- };
18
+ };
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["da"] = {
15
15
  months: "%d måneder",
16
16
  year: "ca. et år",
17
17
  years: "%d år"
18
- };
18
+ };
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["de"] = {
15
15
  months: "%d Monaten",
16
16
  year: "etwa einem Jahr",
17
17
  years: "%d Jahren"
18
- };
18
+ };
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["el"] = {
15
15
  months: "%d μήνες",
16
16
  year: "περίπου ένα χρόνο",
17
17
  years: "%d χρόνια"
18
- };
18
+ };
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["es"] = {
15
15
  months: "%d meses",
16
16
  year: "un año",
17
17
  years: "%d años"
18
- };
18
+ };
@@ -0,0 +1,18 @@
1
+ // Estonian
2
+ jQuery.timeago.settings.strings["et"] = {
3
+ prefixAgo: null,
4
+ prefixFromNow: null,
5
+ suffixAgo: "tagasi",
6
+ suffixFromNow: "pärast",
7
+ seconds: function(n, d) { return d < 0 ? "vähem kui minuti aja" : "vähem kui minut aega" },
8
+ minute: function(n, d) { return d < 0 ? "umbes minuti aja" : "umbes minut aega" },
9
+ minutes: function(n, d) { return d < 0 ? "%d minuti" : "%d minutit" },
10
+ hour: function(n, d) { return d < 0 ? "umbes tunni aja" : "umbes tund aega" },
11
+ hours: function(n, d) { return d < 0 ? "%d tunni" : "%d tundi" },
12
+ day: function(n, d) { return d < 0 ? "umbes päeva" : "umbes päev" },
13
+ days: function(n, d) { return d < 0 ? "%d päeva" : "%d päeva" },
14
+ month: function(n, d) { return d < 0 ? "umbes kuu aja" : "umbes kuu aega" },
15
+ months: function(n, d) { return d < 0 ? "%d kuu" : "%d kuud" },
16
+ year: function(n, d) { return d < 0 ? "umbes aasta aja" : "umbes aasta aega" },
17
+ years: function(n, d) { return d < 0 ? "%d aasta" : "%d aastat" }
18
+ };
@@ -19,4 +19,4 @@ jQuery.timeago.settings.strings["fa"] = {
19
19
  year: "حدود یک سال",
20
20
  years: "%d سال",
21
21
  wordSeparator: " "
22
- };
22
+ };
@@ -25,4 +25,4 @@ jQuery.timeago.settings.strings["fi"] = {
25
25
  // to the end of the word). The word "day" is "päivä" in Finnish.
26
26
  // As workaround, the above localizations will say
27
27
  // "2 päivää tulevaisuudessa" which is understandable but
28
- // not as fluent.
28
+ // not as fluent.
@@ -13,4 +13,4 @@ jQuery.timeago.settings.strings["fr-short"] = {
13
13
  months: "%d mois",
14
14
  year: "un an",
15
15
  years: "%d ans"
16
- };
16
+ };
@@ -14,4 +14,4 @@ jQuery.timeago.settings.strings["fr"] = {
14
14
  months: "environ %d mois",
15
15
  year: "un an",
16
16
  years: "%d ans"
17
- };
17
+ };
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["he"] = {
15
15
  months: "%d חודשים",
16
16
  year: "שנה",
17
17
  years: "%d שנים"
18
- };
18
+ };
@@ -46,4 +46,4 @@
46
46
  wordSeparator: " "
47
47
  };
48
48
 
49
- }).call(this);
49
+ }).call(this);
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["hu"] = {
15
15
  months: "%d hónapja",
16
16
  year: "körülbelül egy éve",
17
17
  years: "%d éve"
18
- };
18
+ };
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["hy"] = {
15
15
  months: "%d ամիս",
16
16
  year: "մեկ տարի",
17
17
  years: "%d տարի"
18
- };
18
+ };
@@ -12,7 +12,7 @@ jQuery.timeago.settings.strings["id"] = {
12
12
  day: "sehari",
13
13
  days: "%d hari",
14
14
  month: "sekitar sebulan",
15
- months: "%d tahun",
15
+ months: "%d bulan",
16
16
  year: "sekitar setahun",
17
17
  years: "%d tahun"
18
- };
18
+ };
@@ -13,4 +13,4 @@ jQuery.timeago.settings.strings["it"] = {
13
13
  months: "%d mesi",
14
14
  year: "circa un anno",
15
15
  years: "%d anni"
16
- };
16
+ };
@@ -14,4 +14,4 @@ jQuery.timeago.settings.strings["ko"] = {
14
14
  year: "1년",
15
15
  years: "%d년",
16
16
  wordSeparator: " "
17
- };
17
+ };
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["no"] = {
15
15
  months: "%d måneder",
16
16
  year: "ca. et år",
17
17
  years: "%d år"
18
- };
18
+ };
@@ -28,4 +28,4 @@
28
28
  year: "rok",
29
29
  years: function(value) { return numpf(value, "%d lata", "%d lat"); }
30
30
  };
31
- })();
31
+ })();
@@ -13,4 +13,4 @@ jQuery.timeago.settings.strings["pt"] = {
13
13
  months: "%d meses",
14
14
  year: "cerca de um ano",
15
15
  years: "%d anos"
16
- };
16
+ };
@@ -15,4 +15,4 @@ $.timeago.settings.strings["ro"] = {
15
15
  months: "%d luni",
16
16
  year: "un an",
17
17
  years: "%d ani"
18
- };
18
+ };
@@ -0,0 +1,49 @@
1
+ // Serbian
2
+ (function () {
3
+ var numpf;
4
+
5
+ numpf = function (n, f, s, t) {
6
+ var n10;
7
+ n10 = n % 10;
8
+ if (n10 === 1 && (n === 1 || n > 20)) {
9
+ return f;
10
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
11
+ return s;
12
+ } else {
13
+ return t;
14
+ }
15
+ };
16
+
17
+ jQuery.timeago.settings.strings["rs"] = {
18
+ prefixAgo: "pre",
19
+ prefixFromNow: "za",
20
+ suffixAgo: null,
21
+ suffixFromNow: null,
22
+ second: "sekund",
23
+ seconds: function (value) {
24
+ return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
25
+ },
26
+ minute: "oko minut",
27
+ minutes: function (value) {
28
+ return numpf(value, "%d minut", "%d minuta", "%d minuta");
29
+ },
30
+ hour: "oko jedan sat",
31
+ hours: function (value) {
32
+ return numpf(value, "%d sat", "%d sata", "%d sati");
33
+ },
34
+ day: "jedan dan",
35
+ days: function (value) {
36
+ return numpf(value, "%d dan", "%d dana", "%d dana");
37
+ },
38
+ month: "mesec dana",
39
+ months: function (value) {
40
+ return numpf(value, "%d mesec", "%d meseca", "%d meseci");
41
+ },
42
+ year: "pre godinu dana",
43
+ years: function (value) {
44
+ return numpf(value, "%d godinu", "%d godine", "%d godina");
45
+ },
46
+ wordSeparator: " "
47
+ };
48
+
49
+ }).call(this);
@@ -31,4 +31,4 @@
31
31
  year: "год",
32
32
  years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); }
33
33
  };
34
- })();
34
+ })();
@@ -15,4 +15,4 @@ jQuery.timeago.settings.strings["sv"] = {
15
15
  months: "%d månader",
16
16
  year: "ungefär ett år",
17
17
  years: "%d år"
18
- };
18
+ };
@@ -13,4 +13,4 @@ jQuery.extend($.timeago.settings.strings["tr"], {
13
13
  months: '%d ay',
14
14
  year: '1 yıl',
15
15
  years: '%d yıl'
16
- });
16
+ });
@@ -31,4 +31,4 @@
31
31
  year: "рік",
32
32
  years: function(value) { return numpf(value, "%d рік", "%d роки", "%d років"); }
33
33
  };
34
- })();
34
+ })();
@@ -17,4 +17,4 @@ jQuery.timeago.settings.strings["zh-CN"] = {
17
17
  years: "%d 年",
18
18
  numbers: [],
19
19
  wordSeparator: ""
20
- };
20
+ };
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-timeago
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-24 00:00:00.000000000 Z
11
+ date: 2013-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -86,6 +86,7 @@ files:
86
86
  - vendor/assets/javascripts/locales/jquery.timeago.el.js
87
87
  - vendor/assets/javascripts/locales/jquery.timeago.en-short.js
88
88
  - vendor/assets/javascripts/locales/jquery.timeago.es.js
89
+ - vendor/assets/javascripts/locales/jquery.timeago.et.js
89
90
  - vendor/assets/javascripts/locales/jquery.timeago.fa.js
90
91
  - vendor/assets/javascripts/locales/jquery.timeago.fi.js
91
92
  - vendor/assets/javascripts/locales/jquery.timeago.fr-short.js
@@ -106,6 +107,7 @@ files:
106
107
  - vendor/assets/javascripts/locales/jquery.timeago.pt-br.js
107
108
  - vendor/assets/javascripts/locales/jquery.timeago.pt.js
108
109
  - vendor/assets/javascripts/locales/jquery.timeago.ro.js
110
+ - vendor/assets/javascripts/locales/jquery.timeago.rs.js
109
111
  - vendor/assets/javascripts/locales/jquery.timeago.ru.js
110
112
  - vendor/assets/javascripts/locales/jquery.timeago.sk.js
111
113
  - vendor/assets/javascripts/locales/jquery.timeago.sl.js
@@ -141,3 +143,4 @@ signing_key:
141
143
  specification_version: 4
142
144
  summary: A Rails Helper to create time tags usable for jQuery Timeago plugin
143
145
  test_files: []
146
+ has_rdoc: