jekyll-timeago 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/jekyll-timeago.gemspec +1 -1
- data/lib/jekyll-timeago/core.rb +5 -10
- data/lib/jekyll-timeago/version.rb +1 -1
- data/lib/locales/en.yml +14 -9
- data/lib/locales/es.yml +14 -9
- data/lib/locales/fr.yml +14 -9
- data/lib/locales/it.yml +14 -9
- data/lib/locales/pt.yml +14 -9
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9157c15480bb342a742abfdc196b96222086a4bd
|
4
|
+
data.tar.gz: fa1791b4fc65d3a7e7ae0d9c4f2b58f0823d0a53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 056d1d1518bc15ed5a72fc67c7786fcc26fa2071ff85c9a08e5cb96a67516429a9dcdb06484d6d2f996bb7e1f32a21b93357a7eeb52bb7c603954963e6eea829
|
7
|
+
data.tar.gz: c55deb51bb798c490d524d6a9e88a567cb262f9048b968e210b28f65a9ffb20fe3ae95c3262d916e201d3b78cf35cd3554a8ee2d2c10af738e04988c26617856
|
data/Gemfile
CHANGED
data/README.md
CHANGED
data/jekyll-timeago.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
16
|
spec.require_paths = ["lib"]
|
17
17
|
|
18
|
-
spec.add_dependency "mini_i18n", '~> 0.
|
18
|
+
spec.add_dependency "mini_i18n", '~> 0.4.0'
|
19
19
|
|
20
20
|
spec.add_development_dependency "jekyll", ">= 1.5"
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
data/lib/jekyll-timeago/core.rb
CHANGED
@@ -46,8 +46,8 @@ module Jekyll
|
|
46
46
|
(1..MAX_DEPTH_LEVEL).include?(depth) ? depth : DEFAULT_DEPTH_LEVEL
|
47
47
|
end
|
48
48
|
|
49
|
-
def t(key)
|
50
|
-
MiniI18n.translate(key, @options)
|
49
|
+
def t(key, options = {})
|
50
|
+
MiniI18n.translate(key, @options.merge(options))
|
51
51
|
end
|
52
52
|
|
53
53
|
# Days passed to time ago sentence
|
@@ -80,14 +80,9 @@ module Jekyll
|
|
80
80
|
days = DAYS_PER[time_range]
|
81
81
|
num_elems = (days_passed / days).to_i
|
82
82
|
|
83
|
-
|
84
|
-
t(time_range[0...-1]) # singularize key
|
85
|
-
else
|
86
|
-
t(time_range)
|
87
|
-
end
|
83
|
+
current_slots << t(time_range, count: num_elems)
|
88
84
|
|
89
|
-
|
90
|
-
pending_days = days_passed - (num_elems * days)
|
85
|
+
pending_days = days_passed - (num_elems * days)
|
91
86
|
build_time_ago_slots(pending_days, depth - 1, current_slots)
|
92
87
|
end
|
93
88
|
|
@@ -110,7 +105,7 @@ module Jekyll
|
|
110
105
|
if slots.length == 1
|
111
106
|
slots[0]
|
112
107
|
else
|
113
|
-
"#{slots[0...-1].join(
|
108
|
+
"#{slots[0...-1].join(t(:words_connector))} #{t(:last_word_connector)} #{slots[-1]}"
|
114
109
|
end
|
115
110
|
end
|
116
111
|
end
|
data/lib/locales/en.yml
CHANGED
@@ -2,16 +2,21 @@ en:
|
|
2
2
|
today: 'today'
|
3
3
|
yesterday: 'yesterday'
|
4
4
|
tomorrow: 'tomorrow'
|
5
|
-
|
5
|
+
last_word_connector: 'and'
|
6
|
+
words_connector: ', '
|
6
7
|
suffix: 'ago'
|
7
8
|
prefix: ''
|
8
9
|
suffix_future: ''
|
9
10
|
prefix_future: 'in'
|
10
|
-
years:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
years:
|
12
|
+
one: '1 year'
|
13
|
+
many: "%{count} years"
|
14
|
+
months:
|
15
|
+
one: '1 month'
|
16
|
+
many: '%{count} months'
|
17
|
+
weeks:
|
18
|
+
one: '1 week'
|
19
|
+
many: '%{count} weeks'
|
20
|
+
days:
|
21
|
+
one: '1 day'
|
22
|
+
many: '%{count} days'
|
data/lib/locales/es.yml
CHANGED
@@ -2,16 +2,21 @@ es:
|
|
2
2
|
today: 'hoy'
|
3
3
|
yesterday: 'ayer'
|
4
4
|
tomorrow: 'mañana'
|
5
|
-
|
5
|
+
last_word_connector: 'y'
|
6
|
+
words_connector: ', '
|
6
7
|
suffix: ''
|
7
8
|
prefix: 'hace'
|
8
9
|
suffix_future: ''
|
9
10
|
prefix_future: 'en'
|
10
|
-
years:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
years:
|
12
|
+
one: '1 año'
|
13
|
+
many: "%{count} años"
|
14
|
+
months:
|
15
|
+
one: '1 mes'
|
16
|
+
many: '%{count} meses'
|
17
|
+
weeks:
|
18
|
+
one: '1 semana'
|
19
|
+
many: '%{count} semanas'
|
20
|
+
days:
|
21
|
+
one: '1 día'
|
22
|
+
many: '%{count} días'
|
data/lib/locales/fr.yml
CHANGED
@@ -2,16 +2,21 @@ fr:
|
|
2
2
|
today: "aujourd'hui"
|
3
3
|
yesterday: 'hier'
|
4
4
|
tomorrow: 'demain'
|
5
|
-
|
5
|
+
last_word_connector: 'et'
|
6
|
+
words_connector: ', '
|
6
7
|
suffix: ''
|
7
8
|
prefix: 'il y a environ'
|
8
9
|
suffix_future: ''
|
9
10
|
prefix_future: 'dans'
|
10
|
-
years:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
years:
|
12
|
+
one: '1 année'
|
13
|
+
many: "%{count} années"
|
14
|
+
months:
|
15
|
+
one: '1 mois'
|
16
|
+
many: '%{count} mois'
|
17
|
+
weeks:
|
18
|
+
one: '1 semaine'
|
19
|
+
many: '%{count} semaines'
|
20
|
+
days:
|
21
|
+
one: '1 jour'
|
22
|
+
many: '%{count} jours'
|
data/lib/locales/it.yml
CHANGED
@@ -2,16 +2,21 @@ it:
|
|
2
2
|
today: 'oggi'
|
3
3
|
yesterday: 'ieri'
|
4
4
|
tomorrow: 'domani'
|
5
|
-
|
5
|
+
last_word_connector: 'e'
|
6
|
+
words_connector: ', '
|
6
7
|
suffix: 'fa'
|
7
8
|
prefix: ''
|
8
9
|
suffix_future: ''
|
9
10
|
prefix_future: 'fra'
|
10
|
-
years:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
years:
|
12
|
+
one: '1 anno'
|
13
|
+
many: "%{count} anni"
|
14
|
+
months:
|
15
|
+
one: '1 mese'
|
16
|
+
many: '%{count} mesi'
|
17
|
+
weeks:
|
18
|
+
one: '1 settimana'
|
19
|
+
many: '%{count} settimane'
|
20
|
+
days:
|
21
|
+
one: '1 giorno'
|
22
|
+
many: '%{count} giorni'
|
data/lib/locales/pt.yml
CHANGED
@@ -2,16 +2,21 @@ pt:
|
|
2
2
|
today: 'hoje'
|
3
3
|
yesterday: 'ontem'
|
4
4
|
tomorrow: 'amanhã'
|
5
|
-
|
5
|
+
last_word_connector: 'e'
|
6
|
+
words_connector: ', '
|
6
7
|
suffix: 'atrás'
|
7
8
|
prefix: ''
|
8
9
|
suffix_future: ''
|
9
10
|
prefix_future: 'em'
|
10
|
-
years:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
years:
|
12
|
+
one: '1 ano'
|
13
|
+
many: "%{count} anos"
|
14
|
+
months:
|
15
|
+
one: '1 mês'
|
16
|
+
many: '%{count} meses'
|
17
|
+
weeks:
|
18
|
+
one: '1 semana'
|
19
|
+
many: '%{count} semanas'
|
20
|
+
days:
|
21
|
+
one: '1 dia'
|
22
|
+
many: '%{count} dias'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-timeago
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_i18n
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jekyll
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
165
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.
|
166
|
+
rubygems_version: 2.6.13
|
167
167
|
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: A date helper to compute distance of dates in words.
|