jekyll-multiple-languages-plugin 1.2.5 → 1.2.6

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: 9c62b83447dfb672db4e214ae3e9d64bad83788e
4
- data.tar.gz: d1db48cc7b9a2f8cd2a67c5bb5bd9b860f10a3cf
3
+ metadata.gz: bbcdc906fcb48165b18fa9a718fcd0eb884e9930
4
+ data.tar.gz: 29e2b75850e04368daa5a44d122120a786b46d53
5
5
  SHA512:
6
- metadata.gz: e2230b6922100d16fdd678e6b68e1a520c1256d85241bee74260941aff41b5c5b5e37603d3e6c396821bca39fe5ca4e93add4b00f5d0a60c8ae618442a22aec0
7
- data.tar.gz: ebb45c393fdfeb2bb927dfbe554a5203b6b305527aee5c8feb2d1337238ec896a44ce3c067ec2714f93a48e95e0d4dd3f4d9ee31e949a726c591c6645ad341da
6
+ metadata.gz: 8ce1a9bd7dbae43dfed4787f63e8a42f652e6c6d0542fe1998106b8e39b0410c5b82c3dc45a0c572c8e1e72126e40b24d4f5cac1922603f60c13dc4224b62b6c
7
+ data.tar.gz: 5c03f7adfe4c8febe35828627baeabba049ce1873cf82e20a0eac646c12fad6e85ea65132882d3f903d487f534dc452a38536ac6aff344a98265042474ae448b
data/README.md CHANGED
@@ -60,17 +60,19 @@ 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
65
- 1.2.4
66
- Fixed a bug when changes in .yml files got lost during live reload.
67
- 1.2.3
68
- Much, much, much faster compilation when lots of translated strings.
63
+ * 1.2.6
64
+ * Added fallback to default language, thanks to [@agramian](https://github.com/agramian)
65
+ * 1.2.5
66
+ * Fixed a bug when global variables wasn't as global as expected
67
+ * 1.2.4
68
+ * Fixed a bug when changes in .yml files got lost during live reload.
69
+ * 1.2.3
70
+ * Much, much, much faster compilation when lots of translated strings.
69
71
  * 1.2.2
70
72
  * Supports translated posts in Octopress
71
73
  * 1.2.1
72
74
  * Supports writing translated posts in Jekyll
73
- * Supports Octopress
75
+ * Supports translated .yml files in Octopress
74
76
  * 1.2.0
75
77
  * Renamed the project to jekyll-multiple-languages-plugin
76
78
  * 1.1.2
@@ -221,3 +223,8 @@ This snippet will create a link that will toggle between Swedish and English. A
221
223
  3. Commit your changes (`git commit -am 'Add some feature'`)
222
224
  4. Push to the branch (`git push origin my-new-feature`)
223
225
  5. Create new Pull Request
226
+
227
+ ### Contributors
228
+ - [Bersch](https://github.com/bersch), better paths
229
+ - [Davrandom](https://github.com/davrandom), plugin usage example
230
+ - [agramian](https://github.com/agramian), fallback to default language
@@ -21,7 +21,7 @@ module Jekyll
21
21
  dest_org = self.dest
22
22
 
23
23
  #Loop
24
- self.config['lang'] = languages.first
24
+ self.config['lang'] = self.config['default_lang'] = languages.first
25
25
  puts
26
26
  puts "Building site for default language: \"#{self.config['lang']}\" to: #{self.dest}"
27
27
  process_org
@@ -71,12 +71,12 @@ module Jekyll
71
71
  Jekyll.langs[lang] = YAML.load_file("#{context.registers[:site].source}/_i18n/#{lang}.yml")
72
72
  end
73
73
  translation = Jekyll.langs[lang].access(key) if key.is_a?(String)
74
- if translation.empty?
74
+ if translation.nil? or translation.empty?
75
+ translation = Jekyll.langs[context.registers[:site].config['default_lang']].access(key)
75
76
  puts "Missing i18n key: #{lang}:#{key}"
76
- "*#{lang}:#{key}*"
77
- else
78
- translation
77
+ puts "Using translation '%s' from default language: %s" %[translation, context.registers[:site].config['default_lang']]
79
78
  end
79
+ translation
80
80
  end
81
81
  end
82
82
 
@@ -2,7 +2,7 @@ module Jekyll
2
2
  module Multiple
3
3
  module Languages
4
4
  module Plugin
5
- VERSION = "1.2.5"
5
+ VERSION = "1.2.6"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-multiple-languages-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Kurtsson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-11 00:00:00.000000000 Z
11
+ date: 2014-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler