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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6690dd05a4827a44c3299e6ab3ff0f9dc008379
4
- data.tar.gz: cd2d422eaa587d037a5fc71717201c2f1e2b3018
3
+ metadata.gz: 9157c15480bb342a742abfdc196b96222086a4bd
4
+ data.tar.gz: fa1791b4fc65d3a7e7ae0d9c4f2b58f0823d0a53
5
5
  SHA512:
6
- metadata.gz: c0e78eff967fed89807fe9a2c2d64c0f6278a19ca069f5320c6198e1dafee198087e2cdbf53c05f8884b0652634116295d48b345dfa9d40800b93563d453d026
7
- data.tar.gz: 8228448f9792aa740956386bcad762465eb799375a24fffc0dae8a2698ac8082eabc7317d84d41ca15096eee50e889a3fe9efe81cf386e96e886f0935dada702
6
+ metadata.gz: 056d1d1518bc15ed5a72fc67c7786fcc26fa2071ff85c9a08e5cb96a67516429a9dcdb06484d6d2f996bb7e1f32a21b93357a7eeb52bb7c603954963e6eea829
7
+ data.tar.gz: c55deb51bb798c490d524d6a9e88a567cb262f9048b968e210b28f65a9ffb20fe3ae95c3262d916e201d3b78cf35cd3554a8ee2d2c10af738e04988c26617856
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gemspec
3
+ gemspec
data/README.md CHANGED
@@ -182,7 +182,7 @@ end
182
182
 
183
183
  ### Configuration
184
184
 
185
- In your `_config.yml` file:
185
+ In your `_config.yml` file, you can customize the following options:
186
186
 
187
187
  ```yaml
188
188
  jekyll_timeago:
@@ -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.3.1'
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"
@@ -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
- range_type = if num_elems == 1
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
- current_slots << "#{num_elems} #{range_type}"
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(', ')} #{t(:and)} #{slots[-1]}"
108
+ "#{slots[0...-1].join(t(:words_connector))} #{t(:last_word_connector)} #{slots[-1]}"
114
109
  end
115
110
  end
116
111
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Timeago
3
- VERSION = "0.10.1"
3
+ VERSION = "0.11.0"
4
4
  end
5
5
  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
- and: 'and'
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: 'years'
11
- year: 'year'
12
- months: 'months'
13
- month: 'month'
14
- weeks: 'weeks'
15
- week: 'week'
16
- days: 'days'
17
- day: 'day'
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
- and: 'y'
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: 'años'
11
- year: 'año'
12
- months: 'meses'
13
- month: 'mes'
14
- weeks: 'semanas'
15
- week: 'semana'
16
- days: 'días'
17
- day: 'día'
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
- and: 'et'
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: 'années'
11
- year: 'année'
12
- months: 'mois'
13
- month: 'mois'
14
- weeks: 'semaines'
15
- week: 'semaine'
16
- days: 'jours'
17
- day: 'jour'
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
- and: 'e'
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: 'anni'
11
- year: 'anno'
12
- months: 'mesi'
13
- month: 'mese'
14
- weeks: 'settimane'
15
- week: 'settimana'
16
- days: 'giorni'
17
- day: 'giorno'
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
- and: 'e'
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: 'anos'
11
- year: 'ano'
12
- months: 'meses'
13
- month: 'mês'
14
- weeks: 'semanas'
15
- week: 'semanas'
16
- days: 'dias'
17
- day: 'dia'
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.10.1
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-25 00:00:00.000000000 Z
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.3.1
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.3.1
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.5.1
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.