jekyll-localization 0.0.3 → 0.0.4

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/ChangeLog CHANGED
@@ -1,5 +1,9 @@
1
1
  = Revision history for jekyll-localization
2
2
 
3
+ == 0.0.4 [2010-09-27]
4
+
5
+ * Fixed filter to work with Liquid.
6
+
3
7
  == 0.0.3 [2010-09-16]
4
8
 
5
9
  * Use alternate page contenten if a page is empty in one language
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to jekyll-localization version 0.0.3
5
+ This documentation refers to jekyll-localization version 0.0.4
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -11,7 +11,7 @@ Jekyll plugin that adds localization features to the rendering engine.
11
11
 
12
12
  Add the following to your <tt>_plugins/ext.rb</tt> file:
13
13
 
14
- require 'jekyll-localization'
14
+ require 'jekyll/localization'
15
15
 
16
16
  Then start using Jekyll::Filters#t in your templates, which will extract
17
17
  the target language from the file name (<tt><NAME>.<LANG>.<EXT></tt>,
@@ -37,12 +37,7 @@ RubyGem:: <http://rubygems.org/gems/jekyll-localization>
37
37
  == AUTHORS
38
38
 
39
39
  * Jens Wille <mailto:jens.wille@uni-koeln.de>
40
-
41
-
42
- == CREDITS
43
-
44
- * Arne Eilermann <mailto:arne.eilermann@uni-koeln.de> for the original idea
45
- and implementation.
40
+ * Arne Eilermann <mailto:eilermann@lavabit.com>
46
41
 
47
42
 
48
43
  == LICENSE AND COPYRIGHT
data/Rakefile CHANGED
@@ -8,21 +8,22 @@ begin
8
8
  :name => %q{jekyll-localization},
9
9
  :version => Jekyll::Localization::VERSION,
10
10
  :summary => %q{Jekyll plugin that adds localization features to the rendering engine.},
11
+ :authors => ['Jens Wille', 'Arne Eilermann'],
12
+ :email => ['jens.wille@uni-koeln.de', 'eilermann@lavabit.com'],
13
+ :homepage => 'http://github.com/blackwinter/jekyll-localization',
11
14
  :files => FileList['lib/**/*.rb'].to_a,
12
15
  :extra_files => FileList['[A-Z]*'].to_a,
13
- :dependencies => %w[jekyll-rendering],
14
- :authors => ["Jens Wille"],
15
- :email => %q{jens.wille@uni-koeln.de}
16
+ :dependencies => %w[jekyll-rendering]
16
17
  }
17
18
  }}
18
- rescue LoadError
19
- warn "Please install the `hen' gem."
19
+ rescue LoadError => err
20
+ warn "Please install the `hen' gem. (#{err})"
20
21
  end
21
22
 
22
23
  ### Place your custom Rake tasks here.
23
24
 
24
25
  begin
25
26
  require 'jekyll/testtasks/rake'
26
- rescue LoadError
27
- warn "Please install the `jekyll-testtasks' gem."
27
+ rescue LoadError => err
28
+ warn "Please install the `jekyll-testtasks' gem. (#{err})"
28
29
  end
@@ -64,9 +64,6 @@ module Jekyll
64
64
  end
65
65
  end
66
66
 
67
- # call-seq:
68
- #
69
- #
70
67
  # Extracts language extension from +name+, or all relevant parts
71
68
  # if +all+ is true.
72
69
  def extract_lang(name, all = false)
@@ -152,9 +149,17 @@ module Jekyll
152
149
 
153
150
  module Filters
154
151
 
152
+ def lang
153
+ if @context.respond_to?(:find_variable, true)
154
+ @context.send(:find_variable, 'page')['lang']
155
+ else
156
+ page.lang
157
+ end
158
+ end
159
+
155
160
  # call-seq:
156
161
  # t 'default', 'translation', ... => aString (Ruby-style)
157
- # ['default', 'translation', ...] | t => aString (Liquid-style)
162
+ # 'default' | t: 'translation', ... => aString (Liquid-style)
158
163
  #
159
164
  # Returns the argument whose position corresponds to the current
160
165
  # language's position in the Localization::LANGUAGES array. If that
@@ -162,7 +167,7 @@ module Jekyll
162
167
  def t(*translations)
163
168
  translations.flatten!
164
169
 
165
- index = Localization::LANGUAGES.index(page.lang)
170
+ index = Localization::LANGUAGES.index(lang)
166
171
  index && translations[index] || translations.first
167
172
  end
168
173
 
@@ -6,7 +6,7 @@ module Jekyll
6
6
 
7
7
  MAJOR = 0
8
8
  MINOR = 0
9
- TINY = 3
9
+ TINY = 4
10
10
 
11
11
  class << self
12
12
 
metadata CHANGED
@@ -1,36 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-localization
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 3
9
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
10
11
  platform: ruby
11
12
  authors:
12
13
  - Jens Wille
14
+ - Arne Eilermann
13
15
  autorequire:
14
16
  bindir: bin
15
17
  cert_chain: []
16
18
 
17
- date: 2010-09-16 00:00:00 +02:00
19
+ date: 2010-09-27 00:00:00 +02:00
18
20
  default_executable:
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
21
23
  name: jekyll-rendering
22
24
  prerelease: false
23
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
28
  - - ">="
26
29
  - !ruby/object:Gem::Version
30
+ hash: 3
27
31
  segments:
28
32
  - 0
29
33
  version: "0"
30
34
  type: :runtime
31
35
  version_requirements: *id001
32
36
  description: Jekyll plugin that adds localization features to the rendering engine.
33
- email: jens.wille@uni-koeln.de
37
+ email:
38
+ - jens.wille@uni-koeln.de
39
+ - eilermann@lavabit.com
34
40
  executables: []
35
41
 
36
42
  extensions: []
@@ -40,14 +46,14 @@ extra_rdoc_files:
40
46
  - ChangeLog
41
47
  - README
42
48
  files:
43
- - lib/jekyll/localization/version.rb
44
49
  - lib/jekyll/localization.rb
50
+ - lib/jekyll/localization/version.rb
51
+ - README
52
+ - ChangeLog
45
53
  - Rakefile
46
54
  - COPYING
47
- - ChangeLog
48
- - README
49
55
  has_rdoc: true
50
- homepage:
56
+ homepage: http://github.com/blackwinter/jekyll-localization
51
57
  licenses: []
52
58
 
53
59
  post_install_message:
@@ -58,29 +64,33 @@ rdoc_options:
58
64
  - README
59
65
  - --line-numbers
60
66
  - --inline-source
67
+ - --all
61
68
  - --charset
62
69
  - UTF-8
63
- - --all
64
70
  require_paths:
65
71
  - lib
66
72
  required_ruby_version: !ruby/object:Gem::Requirement
73
+ none: false
67
74
  requirements:
68
75
  - - ">="
69
76
  - !ruby/object:Gem::Version
77
+ hash: 3
70
78
  segments:
71
79
  - 0
72
80
  version: "0"
73
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
+ none: false
74
83
  requirements:
75
84
  - - ">="
76
85
  - !ruby/object:Gem::Version
86
+ hash: 3
77
87
  segments:
78
88
  - 0
79
89
  version: "0"
80
90
  requirements: []
81
91
 
82
92
  rubyforge_project:
83
- rubygems_version: 1.3.6
93
+ rubygems_version: 1.3.7
84
94
  signing_key:
85
95
  specification_version: 3
86
96
  summary: Jekyll plugin that adds localization features to the rendering engine.