rails-timeago 1.1.1 → 1.2.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +62 -30
- data/lib/assets/javascripts/rails-timeago.js +1 -1
- data/lib/rails-timeago.rb +55 -8
- data/lib/rails-timeago/helper.rb +21 -12
- data/lib/rails-timeago/version.rb +4 -3
- data/spec/spec_helper.rb +3 -1
- data/spec/support/stub.rb +4 -2
- data/spec/timeago_spec.rb +2 -4
- data/vendor/assets/javascripts/jquery.timeago.js +4 -3
- data/vendor/assets/javascripts/locales/jquery.timeago.ar.js +32 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.bg.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.bs.js +49 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.ca.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.cy.js +20 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.cz.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.da.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.de.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.el.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.es.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.fa.js +22 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.fi.js +28 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.fr.js +17 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.he.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.hr.js +49 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.hu.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.hy.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.id.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.it.js +16 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.ja.js +19 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.ko.js +17 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.nl.js +16 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.no.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.pl.js +31 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.pt.js +16 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.ro.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.ru.js +34 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.sv.js +18 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.tr.js +16 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.uk.js +34 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.zh-CN.js +20 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.zh-TW.js +20 -0
- metadata +43 -11
data/README.md
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
# rails-timeago
|
2
2
|
|
3
|
-
|
3
|
+
**rails-timeago** provides a timeago_tag helper to create time tags usable for
|
4
4
|
[jQuery Timeago](https://github.com/rmm5t/jquery-timeago) plugin.
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
10
|
-
|
10
|
+
```ruby
|
11
|
+
gem 'rails-timeago'
|
12
|
+
```
|
11
13
|
|
12
14
|
And then execute:
|
13
15
|
|
@@ -19,59 +21,89 @@ Or install it yourself as:
|
|
19
21
|
|
20
22
|
To use bundled jQuery Timeago plugin add this require statement to your application.js file:
|
21
23
|
|
22
|
-
//=require rails-timeago
|
24
|
+
//= require rails-timeago
|
23
25
|
|
24
|
-
This will also convert all matching time tags on page load.
|
26
|
+
This will also convert all matching time tags on page load.
|
25
27
|
|
26
28
|
## Usage
|
27
29
|
|
28
30
|
Use the timeago_tag helper like any other regular tag helper:
|
29
31
|
|
30
|
-
|
32
|
+
```erb
|
33
|
+
<%= timeago_tag Time.zone.now, :nojs => true, :limit => 10.days.ago %>
|
34
|
+
```
|
31
35
|
|
32
36
|
|
33
37
|
### Available options:
|
34
38
|
|
35
|
-
|
39
|
+
**nojs**
|
40
|
+
Add time ago in words as time tag content instead of absolute time.
|
41
|
+
(default: false)
|
36
42
|
|
37
|
-
|
38
|
-
|
43
|
+
**date_only**
|
44
|
+
Only print date as tag content instead of full time.
|
45
|
+
(default: true)
|
39
46
|
|
40
|
-
|
47
|
+
**format**
|
48
|
+
A time format for localize method used to format static time.
|
49
|
+
(default: default)
|
41
50
|
|
42
|
-
|
43
|
-
|
51
|
+
**limit**
|
52
|
+
Set a limit for time ago tags. All dates before given limit will not be converted.
|
53
|
+
(default: 4.days.ago)
|
44
54
|
|
45
|
-
|
55
|
+
**force**
|
56
|
+
Force time ago tag ignoring limit option.
|
57
|
+
(default: false)
|
46
58
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
* limit
|
59
|
+
**default**
|
60
|
+
String that will be returned if time is nil.
|
61
|
+
(default: '-')
|
51
62
|
|
52
|
-
Set a limit for time ago tags. All dates before given limit will not be converted.
|
53
|
-
(default: 4.days.ago)
|
54
|
-
|
55
|
-
* force
|
56
|
-
|
57
|
-
Force time ago tag ignoring limit option.
|
58
|
-
(default: false)
|
59
|
-
|
60
|
-
* default
|
61
|
-
|
62
|
-
String that will be returned if time is nil.
|
63
|
-
(default: '-')
|
64
63
|
|
65
64
|
All other options will be given as options to the time tag helper.
|
66
|
-
|
67
65
|
The above options can be assigned globally as defaults using
|
68
66
|
|
69
|
-
|
67
|
+
```ruby
|
68
|
+
Rails::Timeago.default_options :limit => proc { 20.days.ago }, :nojs => true
|
69
|
+
```
|
70
70
|
|
71
71
|
A global limit should always be given as a block that will be evaluated each time
|
72
72
|
the rails timeago_tag helper is called. That avoids the limit becoming smaller the
|
73
73
|
longer the application runs.
|
74
74
|
|
75
|
+
## I18n
|
76
|
+
|
77
|
+
**Note:** Available since version *1.2.0.rc1*. I18n features are still untested.
|
78
|
+
|
79
|
+
**rails-timeago** provides additional localization features and includes locale
|
80
|
+
files for the following locales taken from [jQuery Timeago](https://github.com/rmm5t/jquery-timeago).
|
81
|
+
|
82
|
+
> ar, bg, bs, ca, cy, cz, da, de, el, en, es, fa, fi, fr,
|
83
|
+
> he, hr, hu, hy, id, it, ja, ko, nl, no, pl, pt, ro, ru,
|
84
|
+
> sv, tr, uk, zh-CN, zh-TW
|
85
|
+
|
86
|
+
**rails-timeago** will automatically include the locale file for your current
|
87
|
+
locale if it is available. You only have to include the following method into
|
88
|
+
your html head tag:
|
89
|
+
|
90
|
+
```ruby
|
91
|
+
<%= timeago_script_tag %>
|
92
|
+
```
|
93
|
+
|
94
|
+
That will add a script include tag to include the needed locale file.
|
95
|
+
**rails-timeago** will also add all locale files to Rails precompiled assets
|
96
|
+
list to allow precompilation. By default all locale files will be included but
|
97
|
+
you can specify a list by adding a initializer similar to:
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
Rails::Timeago.locales = [:en, :de]
|
101
|
+
```
|
102
|
+
|
103
|
+
This will only add English and German locale files to precompiled assets.
|
104
|
+
To add your own locales add a file in JavaScript assets directory named
|
105
|
+
`locales/jquery.timeago.<locale>.js` and add your locale to `Rails::Timeago.locales`.
|
106
|
+
|
75
107
|
## License
|
76
108
|
|
77
109
|
[MIT License](http://www.opensource.org/licenses/mit-license.php)
|
data/lib/rails-timeago.rb
CHANGED
@@ -2,17 +2,64 @@ require "rails-timeago/version"
|
|
2
2
|
require "rails-timeago/helper"
|
3
3
|
|
4
4
|
module Rails
|
5
|
-
module Timeago
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
module Timeago
|
6
|
+
if defined?(::Rails::Engine)
|
7
|
+
class Engine < ::Rails::Engine # :nodoc:
|
8
|
+
initializer 'rails-timeago' do |app|
|
9
|
+
ActiveSupport.on_load(:action_controller) do
|
10
|
+
include Rails::Timeago::Helper
|
11
|
+
end
|
12
|
+
|
13
|
+
ActiveSupport.on_load(:action_view) do
|
14
|
+
include Rails::Timeago::Helper
|
15
|
+
end
|
11
16
|
|
12
|
-
|
13
|
-
|
17
|
+
if app.config.assets.locales
|
18
|
+
app.config.assets.precompile +=
|
19
|
+
app.config.assets.locales.map do |locale|
|
20
|
+
if ::Rails::Timeago.has_locale_file locale
|
21
|
+
'locales/jquery.timeago.' + locale.to_s + '.js'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
elsif ::Rails::Timeago.locales.nil?
|
25
|
+
app.config.assets.precompile +=
|
26
|
+
Dir[Rails::Timeago.locale_path + '*.js'].map do |f|
|
27
|
+
'locales/' + File.basename(f)
|
28
|
+
end
|
29
|
+
else
|
30
|
+
app.config.assets.precompile +=
|
31
|
+
::Rails::Timeago.locales.map do |locale|
|
32
|
+
if ::Rails::Timeago.has_locale_file locale
|
33
|
+
'locales/jquery.timeago.' + locale.to_s + '.js'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
14
37
|
end
|
15
38
|
end
|
16
39
|
end
|
40
|
+
|
41
|
+
def self.locale_path
|
42
|
+
File.dirname(__FILE__) + '/../vendor/assets/javascripts/locales/'
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.locale_file(locale)
|
46
|
+
locale_path + 'jquery.timeago.' + locale.to_s + '.js'
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.has_locale_file(locale)
|
50
|
+
File.exist? locale_file(I18n.locale)
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.locales
|
54
|
+
@locales
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.locales=(*attrs)
|
58
|
+
if attrs[0].kind_of?(Array)
|
59
|
+
@locales = attrs[0].map(&:to_sym)
|
60
|
+
else
|
61
|
+
@locales = attrs.map(&:to_sym)
|
62
|
+
end
|
63
|
+
end
|
17
64
|
end
|
18
65
|
end
|
data/lib/rails-timeago/helper.rb
CHANGED
@@ -18,10 +18,10 @@ module Rails
|
|
18
18
|
# [:+format+]
|
19
19
|
# A time format for localize method used to format static time.
|
20
20
|
# (default: :default)
|
21
|
-
#
|
21
|
+
#
|
22
22
|
# [:+limit+]
|
23
|
-
# Set a limit for time ago tags. All dates before given limit will not be converted.
|
24
|
-
# (default: 4.days.ago)
|
23
|
+
# Set a limit for time ago tags. All dates before given limit will not be converted.
|
24
|
+
# (default: 4.days.ago)
|
25
25
|
#
|
26
26
|
# [:+force+]
|
27
27
|
# Force time ago tag ignoring limit option.
|
@@ -38,7 +38,7 @@ module Rails
|
|
38
38
|
|
39
39
|
time_options = time_options.merge html_options.extract!(*time_options.keys.select{|k| html_options.include?(k)})
|
40
40
|
return time_options[:default] if time.nil?
|
41
|
-
|
41
|
+
|
42
42
|
html_options.merge! :title => I18n.l(time, :format => time_options[:format])
|
43
43
|
time_options[:limit] = time_options[:limit].call if time_options[:limit].is_a?(Proc)
|
44
44
|
|
@@ -54,11 +54,20 @@ module Rails
|
|
54
54
|
|
55
55
|
I18n.l time, :format => time_options[:format]
|
56
56
|
end
|
57
|
+
|
58
|
+
# Return a JavaScript tag to include jQuery timeago
|
59
|
+
# locale file for current locale.
|
60
|
+
def timeago_script_tag
|
61
|
+
if ::Rails::Timeago.has_locale_file(I18n.locale) and I18n.locale != :en
|
62
|
+
return javascript_include_tag 'locales/jquery.timeago.' + I18n.locale.to_s + '.js'
|
63
|
+
end
|
64
|
+
''
|
65
|
+
end
|
57
66
|
end
|
58
67
|
|
59
68
|
# Read or write global rails-timeago default options. If no options are given
|
60
69
|
# the current defaults will be returned.
|
61
|
-
#
|
70
|
+
#
|
62
71
|
# Available options:
|
63
72
|
# [:+nojs+]
|
64
73
|
# Add time ago in words as time tag content instead of absolute time.
|
@@ -71,11 +80,11 @@ module Rails
|
|
71
80
|
# [:+format+]
|
72
81
|
# A time format for localize method used to format static time.
|
73
82
|
# (default: :default)
|
74
|
-
#
|
83
|
+
#
|
75
84
|
# [:+limit+]
|
76
|
-
# Set a limit for time ago tags. All dates before given limit will not be converted.
|
85
|
+
# Set a limit for time ago tags. All dates before given limit will not be converted.
|
77
86
|
# Global limit should be given as a block to reevaluate limit each time timeago_tag is called.
|
78
|
-
# (default: proc { 4.days.ago })
|
87
|
+
# (default: proc { 4.days.ago })
|
79
88
|
#
|
80
89
|
# [:+force+]
|
81
90
|
# Force time ago tag ignoring limit option.
|
@@ -87,9 +96,9 @@ module Rails
|
|
87
96
|
#
|
88
97
|
def self.default_options(opts = nil)
|
89
98
|
@defaults ||= {
|
90
|
-
:nojs => false,
|
91
|
-
:force => false,
|
92
|
-
:format => :default,
|
99
|
+
:nojs => false,
|
100
|
+
:force => false,
|
101
|
+
:format => :default,
|
93
102
|
:limit => proc { 4.days.ago },
|
94
103
|
:date_only => true,
|
95
104
|
:default => '-'
|
@@ -101,4 +110,4 @@ module Rails
|
|
101
110
|
end
|
102
111
|
end
|
103
112
|
end
|
104
|
-
end
|
113
|
+
end
|
@@ -2,11 +2,12 @@ module Rails
|
|
2
2
|
module Timeago
|
3
3
|
module VERSION
|
4
4
|
MAJOR = 1
|
5
|
-
MINOR =
|
6
|
-
PATCH =
|
5
|
+
MINOR = 2
|
6
|
+
PATCH = 0
|
7
|
+
STAGE = 'rc1'
|
7
8
|
|
8
9
|
def self.to_s
|
9
|
-
[MAJOR, MINOR, PATCH].join '.'
|
10
|
+
[MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join '.'
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/stub.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
class TimeagoStub
|
1
|
+
class TimeagoStub
|
2
2
|
include Rails::Timeago::Helper
|
3
3
|
|
4
|
+
I18n.backend.store_translations :en, :hello => 'World'
|
5
|
+
|
4
6
|
def time_tag(time, content, options = {})
|
5
7
|
options = options.map { |k,v| "#{k}=\"#{v}\""}
|
6
8
|
"<time datetime=\"#{time.iso8601}\" #{options.join ' '}>#{content}</time>"
|
@@ -9,4 +11,4 @@ class TimeagoStub
|
|
9
11
|
def time_ago_in_words(time)
|
10
12
|
"%time_ago_in_words%"
|
11
13
|
end
|
12
|
-
end
|
14
|
+
end
|
data/spec/timeago_spec.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
|
2
2
|
require File.dirname(__FILE__) + '/spec_helper'
|
3
|
-
require File.dirname(__FILE__) + '/../lib/rails-timeago/helper.rb'
|
4
|
-
require File.dirname(__FILE__) + '/support/stub.rb'
|
5
3
|
|
6
4
|
describe Rails::Timeago::Helper do
|
7
5
|
before { @stub = TimeagoStub.new }
|
@@ -42,7 +40,7 @@ describe Rails::Timeago::Helper do
|
|
42
40
|
@stub.timeago_tag(time).should include(">#{I18n.l time.to_date}<")
|
43
41
|
end
|
44
42
|
|
45
|
-
it 'should have localized time as content date_only is false' do
|
43
|
+
it 'should have localized time as content if date_only is false' do
|
46
44
|
time = 3.days.ago
|
47
45
|
@stub.timeago_tag(time, :date_only => false).should include(">#{I18n.l time}<")
|
48
46
|
end
|
@@ -85,4 +83,4 @@ describe Rails::Timeago::Helper do
|
|
85
83
|
it "should return default string if time is nil" do
|
86
84
|
@stub.timeago_tag(nil).should == '-'
|
87
85
|
end
|
88
|
-
end
|
86
|
+
end
|
@@ -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 0.11
|
6
|
+
* @version 0.11.1
|
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
|
@@ -11,7 +11,7 @@
|
|
11
11
|
* For usage and examples, visit:
|
12
12
|
* http://timeago.yarp.com/
|
13
13
|
*
|
14
|
-
* Copyright (c) 2008-
|
14
|
+
* Copyright (c) 2008-2012, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
|
15
15
|
*/
|
16
16
|
(function($) {
|
17
17
|
$.timeago = function(timestamp) {
|
@@ -84,7 +84,8 @@
|
|
84
84
|
years < 1.5 && substitute($l.year, 1) ||
|
85
85
|
substitute($l.years, Math.round(years));
|
86
86
|
|
87
|
-
|
87
|
+
var separator = $l.wordSeparator === undefined ? " " : $l.wordSeparator;
|
88
|
+
return $.trim([prefix, words, suffix].join(separator));
|
88
89
|
},
|
89
90
|
parse: function(iso8601) {
|
90
91
|
var s = $.trim(iso8601);
|
@@ -0,0 +1,32 @@
|
|
1
|
+
// Language: Arabic
|
2
|
+
// Translated By Khaled Attia < Khal3d.com >
|
3
|
+
(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
|
+
}
|
14
|
+
}
|
15
|
+
jQuery.timeago.settings.strings = {
|
16
|
+
prefixAgo: "منذ",
|
17
|
+
prefixFromNow: "يتبقى",
|
18
|
+
suffixAgo: null,
|
19
|
+
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 سنه"); }
|
31
|
+
};
|
32
|
+
})();
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Bulgarian
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "преди",
|
4
|
+
prefixFromNow: "след",
|
5
|
+
suffixAgo: null,
|
6
|
+
suffixFromNow: null,
|
7
|
+
seconds: "по-малко от минута",
|
8
|
+
minute: "една минута",
|
9
|
+
minutes: "%d минути",
|
10
|
+
hour: "един час",
|
11
|
+
hours: "%d часа",
|
12
|
+
day: "един ден",
|
13
|
+
days: "%d дни",
|
14
|
+
month: "един месец",
|
15
|
+
months: "%d месеца",
|
16
|
+
year: "една година",
|
17
|
+
years: "%d години"
|
18
|
+
};
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// Bosnian
|
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 = {
|
18
|
+
prefixAgo: "prije",
|
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 minute", "%d minuta");
|
29
|
+
},
|
30
|
+
hour: "oko sat",
|
31
|
+
hours: function(value) {
|
32
|
+
return numpf(value, "%d sat", "%d sata", "%d sati");
|
33
|
+
},
|
34
|
+
day: "oko jednog dana",
|
35
|
+
days: function(value) {
|
36
|
+
return numpf(value, "%d dan", "%d dana", "%d dana");
|
37
|
+
},
|
38
|
+
month: "mjesec dana",
|
39
|
+
months: function(value) {
|
40
|
+
return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
|
41
|
+
},
|
42
|
+
year: "prije godinu dana ",
|
43
|
+
years: function(value) {
|
44
|
+
return numpf(value, "%d godinu", "%d godine", "%d godina");
|
45
|
+
},
|
46
|
+
wordSeparator: " "
|
47
|
+
};
|
48
|
+
|
49
|
+
}).call(this);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Catalan
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "fa",
|
4
|
+
prefixFromNow: "d'aqui a",
|
5
|
+
suffixAgo: null,
|
6
|
+
suffixFromNow: null,
|
7
|
+
seconds: "menys d'1 minut",
|
8
|
+
minute: "1 minut",
|
9
|
+
minutes: "uns %d minuts",
|
10
|
+
hour: "1 hora",
|
11
|
+
hours: "unes %d hores",
|
12
|
+
day: "1 dia",
|
13
|
+
days: "%d dies",
|
14
|
+
month: "aproximadament un mes",
|
15
|
+
months: "%d mesos",
|
16
|
+
year: "aproximadament un any",
|
17
|
+
years: "%d anys"
|
18
|
+
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// Welsh
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: null,
|
4
|
+
prefixFromNow: null,
|
5
|
+
suffixAgo: "yn ôl",
|
6
|
+
suffixFromNow: "o hyn",
|
7
|
+
seconds: "llai na munud",
|
8
|
+
minute: "am funud",
|
9
|
+
minutes: "%d munud",
|
10
|
+
hour: "tua awr",
|
11
|
+
hours: "am %d awr",
|
12
|
+
day: "y dydd",
|
13
|
+
days: "%d diwrnod",
|
14
|
+
month: "tua mis",
|
15
|
+
months: "%d mis",
|
16
|
+
year: "am y flwyddyn",
|
17
|
+
years: "%d blynedd",
|
18
|
+
wordSeparator: " ",
|
19
|
+
numbers: []
|
20
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Czech
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "před",
|
4
|
+
prefixFromNow: null,
|
5
|
+
suffixAgo: null,
|
6
|
+
suffixFromNow: null,
|
7
|
+
seconds: "méně než minutou",
|
8
|
+
minute: "minutou",
|
9
|
+
minutes: "%d minutami",
|
10
|
+
hour: "hodinou",
|
11
|
+
hours: "%d hodinami",
|
12
|
+
day: "1 dnem",
|
13
|
+
days: "%d dny",
|
14
|
+
month: "1 měsícem",
|
15
|
+
months: "%d měsíci",
|
16
|
+
year: "1 rokem",
|
17
|
+
years: "%d roky"
|
18
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Danish
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "for",
|
4
|
+
prefixFromNow: "om",
|
5
|
+
suffixAgo: "siden",
|
6
|
+
suffixFromNow: "",
|
7
|
+
seconds: "mindre end et minut",
|
8
|
+
minute: "ca. et minut",
|
9
|
+
minutes: "%d minutter",
|
10
|
+
hour: "ca. en time",
|
11
|
+
hours: "ca. %d timer",
|
12
|
+
day: "en dag",
|
13
|
+
days: "%d dage",
|
14
|
+
month: "ca. en måned",
|
15
|
+
months: "%d måneder",
|
16
|
+
year: "ca. et år",
|
17
|
+
years: "%d år"
|
18
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// German
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "vor",
|
4
|
+
prefixFromNow: "in",
|
5
|
+
suffixAgo: "",
|
6
|
+
suffixFromNow: "",
|
7
|
+
seconds: "wenigen Sekunden",
|
8
|
+
minute: "etwa einer Minute",
|
9
|
+
minutes: "%d Minuten",
|
10
|
+
hour: "etwa einer Stunde",
|
11
|
+
hours: "%d Stunden",
|
12
|
+
day: "etwa einem Tag",
|
13
|
+
days: "%d Tagen",
|
14
|
+
month: "etwa einem Monat",
|
15
|
+
months: "%d Monaten",
|
16
|
+
year: "etwa einem Jahr",
|
17
|
+
years: "%d Jahren"
|
18
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Greek
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "πριν",
|
4
|
+
prefixFromNow: "σε",
|
5
|
+
suffixAgo: "",
|
6
|
+
suffixFromNow: "",
|
7
|
+
seconds: "λιγότερο από ένα λεπτό",
|
8
|
+
minute: "περίπου ένα λεπτό",
|
9
|
+
minutes: "%d λεπτά",
|
10
|
+
hour: "περίπου μία ώρα",
|
11
|
+
hours: "περίπου %d ώρες",
|
12
|
+
day: "μία μέρα",
|
13
|
+
days: "%d μέρες",
|
14
|
+
month: "περίπου ένα μήνα",
|
15
|
+
months: "%d μήνες",
|
16
|
+
year: "περίπου ένα χρόνο",
|
17
|
+
years: "%d χρόνια"
|
18
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Spanish
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "hace",
|
4
|
+
prefixFromNow: "dentro de",
|
5
|
+
suffixAgo: "",
|
6
|
+
suffixFromNow: "",
|
7
|
+
seconds: "menos de un minuto",
|
8
|
+
minute: "un minuto",
|
9
|
+
minutes: "unos %d minutos",
|
10
|
+
hour: "una hora",
|
11
|
+
hours: "%d horas",
|
12
|
+
day: "un día",
|
13
|
+
days: "%d días",
|
14
|
+
month: "un mes",
|
15
|
+
months: "%d meses",
|
16
|
+
year: "un año",
|
17
|
+
years: "%d años"
|
18
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
// Persian
|
3
|
+
// Use DIR attribute for RTL text in Persian Language for ABBR tag .
|
4
|
+
// By MB.seifollahi@gmail.com
|
5
|
+
jQuery.timeago.settings.strings = {
|
6
|
+
prefixAgo: null,
|
7
|
+
prefixFromNow: null,
|
8
|
+
suffixAgo: "پیش",
|
9
|
+
suffixFromNow: "از حال",
|
10
|
+
seconds: "کمتر از یک دقیقه",
|
11
|
+
minute: "حدود یک دقیقه",
|
12
|
+
minutes: "%d دقیقه",
|
13
|
+
hour: "حدود یک ساعت",
|
14
|
+
hours: "حدود %d ساعت",
|
15
|
+
day: "یک روز",
|
16
|
+
days: "%d روز",
|
17
|
+
month: "حدود یک ماه",
|
18
|
+
months: "%d ماه",
|
19
|
+
year: "حدود یک سال",
|
20
|
+
years: "%d سال",
|
21
|
+
wordSeparator: " "
|
22
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// Finnish
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: null,
|
4
|
+
prefixFromNow: null,
|
5
|
+
suffixAgo: "sitten",
|
6
|
+
suffixFromNow: "tulevaisuudessa",
|
7
|
+
seconds: "alle minuutti",
|
8
|
+
minute: "minuutti",
|
9
|
+
minutes: "%d minuuttia",
|
10
|
+
hour: "tunti",
|
11
|
+
hours: "%d tuntia",
|
12
|
+
day: "päivä",
|
13
|
+
days: "%d päivää",
|
14
|
+
month: "kuukausi",
|
15
|
+
months: "%d kuukautta",
|
16
|
+
year: "vuosi",
|
17
|
+
years: "%d vuotta"
|
18
|
+
};
|
19
|
+
|
20
|
+
// The above is not a great localization because one would usually
|
21
|
+
// write "2 days ago" in Finnish as "2 päivää sitten", however
|
22
|
+
// one would write "2 days into the future" as "2:n päivän päästä"
|
23
|
+
// which cannot be achieved with localization support this simple.
|
24
|
+
// This is because Finnish has word suffixes (attached directly
|
25
|
+
// to the end of the word). The word "day" is "päivä" in Finnish.
|
26
|
+
// As workaround, the above localizations will say
|
27
|
+
// "2 päivää tulevaisuudessa" which is understandable but
|
28
|
+
// not as fluent.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// French
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
// environ ~= about, it's optional
|
4
|
+
prefixAgo: "il y a",
|
5
|
+
prefixFromNow: "d'ici",
|
6
|
+
seconds: "moins d'une minute",
|
7
|
+
minute: "environ une minute",
|
8
|
+
minutes: "environ %d minutes",
|
9
|
+
hour: "environ une heure",
|
10
|
+
hours: "environ %d heures",
|
11
|
+
day: "environ un jour",
|
12
|
+
days: "environ %d jours",
|
13
|
+
month: "environ un mois",
|
14
|
+
months: "environ %d mois",
|
15
|
+
year: "un an",
|
16
|
+
years: "%d ans"
|
17
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Hebrew
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "לפני",
|
4
|
+
prefixFromNow: "מעכשיו",
|
5
|
+
suffixAgo: "",
|
6
|
+
suffixFromNow: "",
|
7
|
+
seconds: "פחות מדקה",
|
8
|
+
minute: "דקה",
|
9
|
+
minutes: "%d דקות",
|
10
|
+
hour: "שעה",
|
11
|
+
hours: "%d שעות",
|
12
|
+
day: "יום",
|
13
|
+
days: "%d ימים",
|
14
|
+
month: "חודש",
|
15
|
+
months: "%d חודשים",
|
16
|
+
year: "שנה",
|
17
|
+
years: "%d שנים"
|
18
|
+
};
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// Croatian
|
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 = {
|
18
|
+
prefixAgo: "prije",
|
19
|
+
prefixFromNow: "za",
|
20
|
+
suffixAgo: null,
|
21
|
+
suffixFromNow: null,
|
22
|
+
second: "sekundu",
|
23
|
+
seconds: function (value) {
|
24
|
+
return numpf(value, "%d sekundu", "%d sekunde", "%d sekundi");
|
25
|
+
},
|
26
|
+
minute: "oko minutu",
|
27
|
+
minutes: function (value) {
|
28
|
+
return numpf(value, "%d minutu", "%d minute", "%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: "mjesec dana",
|
39
|
+
months: function (value) {
|
40
|
+
return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
|
41
|
+
},
|
42
|
+
year: "prije godinu dana",
|
43
|
+
years: function (value) {
|
44
|
+
return numpf(value, "%d godinu", "%d godine", "%d godina");
|
45
|
+
},
|
46
|
+
wordSeparator: " "
|
47
|
+
};
|
48
|
+
|
49
|
+
}).call(this);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Hungarian
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: null,
|
4
|
+
prefixFromNow: null,
|
5
|
+
suffixAgo: null,
|
6
|
+
suffixFromNow: null,
|
7
|
+
seconds: "kevesebb mint egy perce",
|
8
|
+
minute: "körülbelül egy perce",
|
9
|
+
minutes: "%d perce",
|
10
|
+
hour: "körülbelül egy órája",
|
11
|
+
hours: "körülbelül %d órája",
|
12
|
+
day: "körülbelül egy napja",
|
13
|
+
days: "%d napja",
|
14
|
+
month: "körülbelül egy hónapja",
|
15
|
+
months: "%d hónapja",
|
16
|
+
year: "körülbelül egy éve",
|
17
|
+
years: "%d éve"
|
18
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Armenian
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: null,
|
4
|
+
prefixFromNow: null,
|
5
|
+
suffixAgo: "առաջ",
|
6
|
+
suffixFromNow: "հետո",
|
7
|
+
seconds: "վայրկյաններ",
|
8
|
+
minute: "մեկ րոպե",
|
9
|
+
minutes: "%d րոպե",
|
10
|
+
hour: "մեկ ժամ",
|
11
|
+
hours: "%d ժամ",
|
12
|
+
day: "մեկ օր",
|
13
|
+
days: "%d օր",
|
14
|
+
month: "մեկ ամիս",
|
15
|
+
months: "%d ամիս",
|
16
|
+
year: "մեկ տարի",
|
17
|
+
years: "%d տարի"
|
18
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Indonesian
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: null,
|
4
|
+
prefixFromNow: null,
|
5
|
+
suffixAgo: "yang lalu",
|
6
|
+
suffixFromNow: "dari sekarang",
|
7
|
+
seconds: "kurang dari semenit",
|
8
|
+
minute: "sekitar satu menit",
|
9
|
+
minutes: "%d menit",
|
10
|
+
hour: "sekitar sejam",
|
11
|
+
hours: "sekitar %d jam",
|
12
|
+
day: "sehari",
|
13
|
+
days: "%d hari",
|
14
|
+
month: "sekitar sebulan",
|
15
|
+
months: "%d tahun",
|
16
|
+
year: "sekitar setahun",
|
17
|
+
years: "%d tahun"
|
18
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// Italian
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
suffixAgo: "fa",
|
4
|
+
suffixFromNow: "da ora",
|
5
|
+
seconds: "meno di un minuto",
|
6
|
+
minute: "circa un minuto",
|
7
|
+
minutes: "%d minuti",
|
8
|
+
hour: "circa un'ora",
|
9
|
+
hours: "circa %d ore",
|
10
|
+
day: "un giorno",
|
11
|
+
days: "%d giorni",
|
12
|
+
month: "circa un mese",
|
13
|
+
months: "%d mesi",
|
14
|
+
year: "circa un anno",
|
15
|
+
years: "%d anni"
|
16
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// Japanese
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "",
|
4
|
+
prefixFromNow: "今から",
|
5
|
+
suffixAgo: "前",
|
6
|
+
suffixFromNow: "後",
|
7
|
+
seconds: "ほんの数秒",
|
8
|
+
minute: "約一分",
|
9
|
+
minutes: "%d 分",
|
10
|
+
hour: "大体一時間",
|
11
|
+
hours: "大体 %d 時間位",
|
12
|
+
day: "一日",
|
13
|
+
days: "%d 日ほど",
|
14
|
+
month: "大体一ヶ月",
|
15
|
+
months: "%d ヶ月ほど",
|
16
|
+
year: "丁度一年(虎舞流w)",
|
17
|
+
years: "%d 年",
|
18
|
+
wordSeparator: ""
|
19
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// Korean
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
suffixAgo: "전",
|
4
|
+
suffixFromNow: "후",
|
5
|
+
seconds: "1분 이내",
|
6
|
+
minute: "1분",
|
7
|
+
minutes: "%d분",
|
8
|
+
hour: "1시간",
|
9
|
+
hours: "%d시간",
|
10
|
+
day: "하루",
|
11
|
+
days: "%d일",
|
12
|
+
month: "한달",
|
13
|
+
months: "%d달",
|
14
|
+
year: "1년",
|
15
|
+
years: "%d년",
|
16
|
+
wordSeparator: ""
|
17
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// Dutch
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
suffixAgo: "geleden",
|
4
|
+
suffixFromNow: "vanaf nu",
|
5
|
+
seconds: "iets minder dan een minuut",
|
6
|
+
minute: "ongeveer een minuut",
|
7
|
+
minutes: "%d minuten",
|
8
|
+
hour: "ongeveer een uur",
|
9
|
+
hours: "ongeveer %d uur",
|
10
|
+
day: "een dag",
|
11
|
+
days: "%d dagen",
|
12
|
+
month: "ongeveer een maand",
|
13
|
+
months: "%d maanden",
|
14
|
+
year: "ongeveer een jaar",
|
15
|
+
years: "%d jaar"
|
16
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Norwegian
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "for",
|
4
|
+
prefixFromNow: "om",
|
5
|
+
suffixAgo: "siden",
|
6
|
+
suffixFromNow: "",
|
7
|
+
seconds: "mindre enn et minutt",
|
8
|
+
minute: "ca. et minutt",
|
9
|
+
minutes: "%d minutter",
|
10
|
+
hour: "ca. en time",
|
11
|
+
hours: "ca. %d timer",
|
12
|
+
day: "en dag",
|
13
|
+
days: "%d dager",
|
14
|
+
month: "ca. en måned",
|
15
|
+
months: "%d måneder",
|
16
|
+
year: "ca. et år",
|
17
|
+
years: "%d år"
|
18
|
+
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
// Polish
|
2
|
+
(function() {
|
3
|
+
function numpf(n, s, t) {
|
4
|
+
// s - 2-4, 22-24, 32-34 ...
|
5
|
+
// t - 5-21, 25-31, ...
|
6
|
+
var n10 = n % 10;
|
7
|
+
if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
|
8
|
+
return s;
|
9
|
+
} else {
|
10
|
+
return t;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
jQuery.timeago.settings.strings = {
|
15
|
+
prefixAgo: null,
|
16
|
+
prefixFromNow: "za",
|
17
|
+
suffixAgo: "temu",
|
18
|
+
suffixFromNow: null,
|
19
|
+
seconds: "mniej niż minutę",
|
20
|
+
minute: "minutę",
|
21
|
+
minutes: function(value) { return numpf(value, "%d minuty", "%d minut"); },
|
22
|
+
hour: "godzinę",
|
23
|
+
hours: function(value) { return numpf(value, "%d godziny", "%d godzin"); },
|
24
|
+
day: "dzień",
|
25
|
+
days: "%d dni",
|
26
|
+
month: "miesiąc",
|
27
|
+
months: function(value) { return numpf(value, "%d miesiące", "%d miesięcy"); },
|
28
|
+
year: "rok",
|
29
|
+
years: function(value) { return numpf(value, "%d lata", "%d lat"); }
|
30
|
+
};
|
31
|
+
})();
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// Portuguese
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
suffixAgo: "atrás",
|
4
|
+
suffixFromNow: "a partir de agora",
|
5
|
+
seconds: "menos de um minuto",
|
6
|
+
minute: "cerca de um minuto",
|
7
|
+
minutes: "%d minutos",
|
8
|
+
hour: "cerca de uma hora",
|
9
|
+
hours: "cerca de %d horas",
|
10
|
+
day: "um dia",
|
11
|
+
days: "%d dias",
|
12
|
+
month: "cerca de um mês",
|
13
|
+
months: "%d meses",
|
14
|
+
year: "cerca de um ano",
|
15
|
+
years: "%d anos"
|
16
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Romanian
|
2
|
+
$.timeago.settings.strings = {
|
3
|
+
prefixAgo: "acum",
|
4
|
+
prefixFromNow: "in timp de",
|
5
|
+
suffixAgo: "",
|
6
|
+
suffixFromNow: "",
|
7
|
+
seconds: "mai putin de un minut",
|
8
|
+
minute: "un minut",
|
9
|
+
minutes: "%d minute",
|
10
|
+
hour: "o ora",
|
11
|
+
hours: "%d ore",
|
12
|
+
day: "o zi",
|
13
|
+
days: "%d zile",
|
14
|
+
month: "o luna",
|
15
|
+
months: "%d luni",
|
16
|
+
year: "un an",
|
17
|
+
years: "%d ani"
|
18
|
+
};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
// Russian
|
2
|
+
(function() {
|
3
|
+
function numpf(n, f, s, t) {
|
4
|
+
// f - 1, 21, 31, ...
|
5
|
+
// s - 2-4, 22-24, 32-34 ...
|
6
|
+
// t - 5-20, 25-30, ...
|
7
|
+
var 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 = {
|
18
|
+
prefixAgo: null,
|
19
|
+
prefixFromNow: "через",
|
20
|
+
suffixAgo: "назад",
|
21
|
+
suffixFromNow: null,
|
22
|
+
seconds: "меньше минуты",
|
23
|
+
minute: "минуту",
|
24
|
+
minutes: function(value) { return numpf(value, "%d минута", "%d минуты", "%d минут"); },
|
25
|
+
hour: "час",
|
26
|
+
hours: function(value) { return numpf(value, "%d час", "%d часа", "%d часов"); },
|
27
|
+
day: "день",
|
28
|
+
days: function(value) { return numpf(value, "%d день", "%d дня", "%d дней"); },
|
29
|
+
month: "месяц",
|
30
|
+
months: function(value) { return numpf(value, "%d месяц", "%d месяца", "%d месяцев"); },
|
31
|
+
year: "год",
|
32
|
+
years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); }
|
33
|
+
};
|
34
|
+
})();
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Swedish
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: "för",
|
4
|
+
prefixFromNow: "om",
|
5
|
+
suffixAgo: "sedan",
|
6
|
+
suffixFromNow: "",
|
7
|
+
seconds: "mindre än en minut",
|
8
|
+
minute: "ungefär en minut",
|
9
|
+
minutes: "%d minuter",
|
10
|
+
hour: "ungefär en timme",
|
11
|
+
hours: "ungefär %d timmar",
|
12
|
+
day: "en dag",
|
13
|
+
days: "%d dagar",
|
14
|
+
month: "ungefär en månad",
|
15
|
+
months: "%d månader",
|
16
|
+
year: "ungefär ett år",
|
17
|
+
years: "%d år"
|
18
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// Turkish
|
2
|
+
jQuery.extend($.timeago.settings.strings, {
|
3
|
+
suffixAgo: 'önce',
|
4
|
+
suffixFromNow: null,
|
5
|
+
seconds: '1 dakikadan',
|
6
|
+
minute: '1 dakika',
|
7
|
+
minutes: '%d dakika',
|
8
|
+
hour: '1 saat',
|
9
|
+
hours: '%d saat',
|
10
|
+
day: '1 gün',
|
11
|
+
days: '%d gün',
|
12
|
+
month: '1 ay',
|
13
|
+
months: '%d ay',
|
14
|
+
year: '1 yıl',
|
15
|
+
years: '%d yıl'
|
16
|
+
});
|
@@ -0,0 +1,34 @@
|
|
1
|
+
// Ukrainian
|
2
|
+
(function() {
|
3
|
+
function numpf(n, f, s, t) {
|
4
|
+
// f - 1, 21, 31, ...
|
5
|
+
// s - 2-4, 22-24, 32-34 ...
|
6
|
+
// t - 5-20, 25-30, ...
|
7
|
+
var 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 = {
|
18
|
+
prefixAgo: null,
|
19
|
+
prefixFromNow: "через",
|
20
|
+
suffixAgo: "тому",
|
21
|
+
suffixFromNow: null,
|
22
|
+
seconds: "меньше хвилини",
|
23
|
+
minute: "хвилина",
|
24
|
+
minutes: function(value) { return numpf(value, "%d хвилина", "%d хвилини", "%d хвилин"); },
|
25
|
+
hour: "година",
|
26
|
+
hours: function(value) { return numpf(value, "%d година", "%d години", "%d годин"); },
|
27
|
+
day: "день",
|
28
|
+
days: function(value) { return numpf(value, "%d день", "%d дні", "%d днів"); },
|
29
|
+
month: "місяць",
|
30
|
+
months: function(value) { return numpf(value, "%d місяць", "%d місяці", "%d місяців"); },
|
31
|
+
year: "рік",
|
32
|
+
years: function(value) { return numpf(value, "%d рік", "%d роки", "%d років"); }
|
33
|
+
};
|
34
|
+
})();
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// Simplified Chinese
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: null,
|
4
|
+
prefixFromNow: "从现在开始",
|
5
|
+
suffixAgo: "之前",
|
6
|
+
suffixFromNow: null,
|
7
|
+
seconds: "不到 1 分钟",
|
8
|
+
minute: "大约 1 分钟",
|
9
|
+
minutes: "%d 分钟",
|
10
|
+
hour: "大约 1 小时",
|
11
|
+
hours: "大约 %d 小时",
|
12
|
+
day: "1 天",
|
13
|
+
days: "%d 天",
|
14
|
+
month: "大约 1 个月",
|
15
|
+
months: "%d 月",
|
16
|
+
year: "大约 1 年",
|
17
|
+
years: "%d 年",
|
18
|
+
numbers: [],
|
19
|
+
wordSeparator: ""
|
20
|
+
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// Traditional Chinese, zh-tw
|
2
|
+
jQuery.timeago.settings.strings = {
|
3
|
+
prefixAgo: null,
|
4
|
+
prefixFromNow: "從現在開始",
|
5
|
+
suffixAgo: "之前",
|
6
|
+
suffixFromNow: null,
|
7
|
+
seconds: "不到 1 分鐘",
|
8
|
+
minute: "大約 1 分鐘",
|
9
|
+
minutes: "%d 分鐘",
|
10
|
+
hour: "大約 1 小時",
|
11
|
+
hours: "大約 %d 小時",
|
12
|
+
day: "1 天",
|
13
|
+
days: "%d 天",
|
14
|
+
month: "大約 1 個月",
|
15
|
+
months: "%d 月",
|
16
|
+
year: "大約 1 年",
|
17
|
+
years: "%d 年",
|
18
|
+
numbers: [],
|
19
|
+
wordSeparator: ""
|
20
|
+
};
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-timeago
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0.rc1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jan Graichen
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &14110720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *14110720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: actionpack
|
27
|
-
requirement: &
|
27
|
+
requirement: &14110120 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '3.1'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *14110120
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &14109600 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *14109600
|
47
47
|
description: jQuery Timeago helper for Rails 3
|
48
48
|
email:
|
49
49
|
- jan.graichen@altimos.de
|
@@ -65,6 +65,38 @@ files:
|
|
65
65
|
- spec/support/stub.rb
|
66
66
|
- spec/timeago_spec.rb
|
67
67
|
- vendor/assets/javascripts/jquery.timeago.js
|
68
|
+
- vendor/assets/javascripts/locales/jquery.timeago.ar.js
|
69
|
+
- vendor/assets/javascripts/locales/jquery.timeago.bg.js
|
70
|
+
- vendor/assets/javascripts/locales/jquery.timeago.bs.js
|
71
|
+
- vendor/assets/javascripts/locales/jquery.timeago.ca.js
|
72
|
+
- vendor/assets/javascripts/locales/jquery.timeago.cy.js
|
73
|
+
- vendor/assets/javascripts/locales/jquery.timeago.cz.js
|
74
|
+
- vendor/assets/javascripts/locales/jquery.timeago.da.js
|
75
|
+
- vendor/assets/javascripts/locales/jquery.timeago.de.js
|
76
|
+
- vendor/assets/javascripts/locales/jquery.timeago.el.js
|
77
|
+
- vendor/assets/javascripts/locales/jquery.timeago.es.js
|
78
|
+
- vendor/assets/javascripts/locales/jquery.timeago.fa.js
|
79
|
+
- vendor/assets/javascripts/locales/jquery.timeago.fi.js
|
80
|
+
- vendor/assets/javascripts/locales/jquery.timeago.fr.js
|
81
|
+
- vendor/assets/javascripts/locales/jquery.timeago.he.js
|
82
|
+
- vendor/assets/javascripts/locales/jquery.timeago.hr.js
|
83
|
+
- vendor/assets/javascripts/locales/jquery.timeago.hu.js
|
84
|
+
- vendor/assets/javascripts/locales/jquery.timeago.hy.js
|
85
|
+
- vendor/assets/javascripts/locales/jquery.timeago.id.js
|
86
|
+
- vendor/assets/javascripts/locales/jquery.timeago.it.js
|
87
|
+
- vendor/assets/javascripts/locales/jquery.timeago.ja.js
|
88
|
+
- vendor/assets/javascripts/locales/jquery.timeago.ko.js
|
89
|
+
- vendor/assets/javascripts/locales/jquery.timeago.nl.js
|
90
|
+
- vendor/assets/javascripts/locales/jquery.timeago.no.js
|
91
|
+
- vendor/assets/javascripts/locales/jquery.timeago.pl.js
|
92
|
+
- vendor/assets/javascripts/locales/jquery.timeago.pt.js
|
93
|
+
- vendor/assets/javascripts/locales/jquery.timeago.ro.js
|
94
|
+
- vendor/assets/javascripts/locales/jquery.timeago.ru.js
|
95
|
+
- vendor/assets/javascripts/locales/jquery.timeago.sv.js
|
96
|
+
- vendor/assets/javascripts/locales/jquery.timeago.tr.js
|
97
|
+
- vendor/assets/javascripts/locales/jquery.timeago.uk.js
|
98
|
+
- vendor/assets/javascripts/locales/jquery.timeago.zh-CN.js
|
99
|
+
- vendor/assets/javascripts/locales/jquery.timeago.zh-TW.js
|
68
100
|
homepage: https://github.com/jgraichen/rails-timeago
|
69
101
|
licenses: []
|
70
102
|
post_install_message:
|
@@ -80,9 +112,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
113
|
none: false
|
82
114
|
requirements:
|
83
|
-
- - ! '
|
115
|
+
- - ! '>'
|
84
116
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
117
|
+
version: 1.3.1
|
86
118
|
requirements: []
|
87
119
|
rubyforge_project:
|
88
120
|
rubygems_version: 1.8.15
|