jekyll-multiple-languages-plugin 1.2.4 → 1.2.5

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: 551cdae0059de1a4a141f18250898108d61dc0f0
4
- data.tar.gz: 614eb16c83196baa24141ce4416393baac779230
3
+ metadata.gz: 9c62b83447dfb672db4e214ae3e9d64bad83788e
4
+ data.tar.gz: d1db48cc7b9a2f8cd2a67c5bb5bd9b860f10a3cf
5
5
  SHA512:
6
- metadata.gz: a6fecaed43e48d9259d6d90d805d2db822627f2c83fd7d6e2955bcf7caa13afdedf1a35ed60ba92ae6832e9d78ee29f0cd0bffb41dece7464392e0e46aec7513
7
- data.tar.gz: 8b1342bc744d051e52dd12ca6dd24102a27a5c1f006beffecb8e000d7ac3efea955d1323fe6efbfc0cdd748d1e3202f559dff92b7ad0a53532b2f122232f5e29
6
+ metadata.gz: e2230b6922100d16fdd678e6b68e1a520c1256d85241bee74260941aff41b5c5b5e37603d3e6c396821bca39fe5ca4e93add4b00f5d0a60c8ae618442a22aec0
7
+ data.tar.gz: ebb45c393fdfeb2bb927dfbe554a5203b6b305527aee5c8feb2d1337238ec896a44ce3c067ec2714f93a48e95e0d4dd3f4d9ee31e949a726c591c6645ad341da
data/README.md CHANGED
@@ -60,6 +60,8 @@ Copy or link the file `lib/jekyll/multiple/languages/plugin.rb` into your `_plug
60
60
  * Supports translated template files
61
61
 
62
62
  ##Changelog
63
+ 1.2.5
64
+ Fixed a bug when global variables wasn't as global as expected
63
65
  1.2.4
64
66
  Fixed a bug when changes in .yml files got lost during live reload.
65
67
  1.2.3
@@ -1,6 +1,13 @@
1
1
  require "jekyll/multiple/languages/plugin/version"
2
2
 
3
3
  module Jekyll
4
+ @parsedlangs = {}
5
+ def self.langs
6
+ @parsedlangs
7
+ end
8
+ def self.setlangs(l)
9
+ @parsedlangs = l
10
+ end
4
11
  class Site
5
12
  alias :process_org :process
6
13
  def process
@@ -31,7 +38,7 @@ module Jekyll
31
38
  self.dest = dest_org
32
39
  self.config['baseurl'] = baseurl_org
33
40
  end
34
- @@langs = {}
41
+ Jekyll.setlangs({})
35
42
  puts 'Build complete'
36
43
  end
37
44
 
@@ -50,7 +57,6 @@ module Jekyll
50
57
  def initialize(tag_name, key, tokens)
51
58
  super
52
59
  @key = key.strip
53
- @@langs ||= {}
54
60
  end
55
61
 
56
62
  def render(context)
@@ -60,11 +66,11 @@ module Jekyll
60
66
  key = @key
61
67
  end
62
68
  lang = context.registers[:site].config['lang']
63
- unless @@langs.has_key?(lang)
69
+ unless Jekyll.langs.has_key?(lang)
64
70
  puts "Loading translation from file #{context.registers[:site].source}/_i18n/#{lang}.yml"
65
- @@langs[lang] = YAML.load_file("#{context.registers[:site].source}/_i18n/#{lang}.yml")
71
+ Jekyll.langs[lang] = YAML.load_file("#{context.registers[:site].source}/_i18n/#{lang}.yml")
66
72
  end
67
- translation = @@langs[lang].access(key) if key.is_a?(String)
73
+ translation = Jekyll.langs[lang].access(key) if key.is_a?(String)
68
74
  if translation.empty?
69
75
  puts "Missing i18n key: #{lang}:#{key}"
70
76
  "*#{lang}:#{key}*"
@@ -2,7 +2,7 @@ module Jekyll
2
2
  module Multiple
3
3
  module Languages
4
4
  module Plugin
5
- VERSION = "1.2.4"
5
+ VERSION = "1.2.5"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-multiple-languages-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Kurtsson