jekyll-multiple-languages-plugin 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +59 -49
- data/lib/jekyll-multiple-languages-plugin.rb +15 -10
- data/lib/plugin/version.rb +1 -1
- metadata +24 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0b3312ac834bde327dd7fc94194998efed8074f344607ef5e7dcad99d0ed44d
|
4
|
+
data.tar.gz: 45f17b6bedf4e0913a15f8a7992ebefb14a6fdc5dbfc4644c9b75205544b91ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a8a704e89521a3a3306e81c16cdf4b291141d75f5743303e42703a9040a9592029c8e06cb32ab72036127646bdb9d4959580c0e48360c85f4943e870e11aa31
|
7
|
+
data.tar.gz: 50036c5ea37b033f66e825f78e568b6fd011d2ebcb525b4c20e0f6cf092c6a2e4bce701a76cddd11f4aa4d0b89c53aefcb1749078192cb1b4739ec72a6e7039f
|
data/README.md
CHANGED
@@ -6,47 +6,53 @@ Jekyll Multiple Languages is an internationalization plugin for [Jekyll](https:/
|
|
6
6
|
|
7
7
|
The plugin was developed as a utility at [Daresay](https://daresay.co)
|
8
8
|
|
9
|
-
###
|
9
|
+
### Badges
|
10
|
+
[![Build Status](https://travis-ci.com/kurtsson/jekyll-multiple-languages-plugin.svg?branch=master)](https://travis-ci.com/kurtsson/jekyll-multiple-languages-plugin)
|
11
|
+
[![Gem Version](https://badge.fury.io/rb/jekyll-multiple-languages-plugin.png)](http://badge.fury.io/rb/jekyll-multiple-languages-plugin)
|
10
12
|
|
13
|
+
## !! We are looking for more maintainers !!
|
14
|
+
|
15
|
+
Are you using this plugin? Could you test and verify incoming PRs? Please give us a shout!
|
11
16
|
|
12
17
|
|
13
18
|
Table of Contents
|
14
19
|
-----------------
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
20
|
+
- [Jekyll Multiple Languages Plugin](#jekyll-multiple-languages-plugin)
|
21
|
+
- [Badges](#badges)
|
22
|
+
- [!! We are looking for more maintainers !!](#we-are-looking-for-more-maintainers)
|
23
|
+
- [Table of Contents](#table-of-contents)
|
24
|
+
- [1. Current Release Notice](#1-current-release-notice)
|
25
|
+
- [2. Features](#2-features)
|
26
|
+
- [3. Installation](#3-installation)
|
27
|
+
- [3.1. Using the gem](#31-using-the-gem)
|
28
|
+
- [3.2. Manually](#32-manually)
|
29
|
+
- [3.3. As a Git Submodule](#33-as-a-git-submodule)
|
30
|
+
- [4. Configuration](#4-configuration)
|
31
|
+
- [4.1. _config.yml](#41-configyml)
|
32
|
+
- [4.2. Folder structure](#42-folder-structure)
|
33
|
+
- [5. Usage](#5-usage)
|
34
|
+
- [5.1. Translating strings](#51-translating-strings)
|
35
|
+
- [5.2. Including translated files](#52-including-translated-files)
|
36
|
+
- [5.3. Permalinks and Translating Links](#53-permalinks-and-translating-links)
|
37
|
+
- [5.4. i18n in templates](#54-i18n-in-templates)
|
38
|
+
- [5.5. Link between languages](#55-link-between-languages)
|
39
|
+
- [5.6. Creating pages](#56-creating-pages)
|
40
|
+
- [5.7. Creating posts](#57-creating-posts)
|
41
|
+
- [6. License](#6-license)
|
42
|
+
- [7. Example website](#7-example-website)
|
43
|
+
- [7.1. Adding a new language](#71-adding-a-new-language)
|
44
|
+
- [7.2. Adding new page](#72-adding-new-page)
|
45
|
+
- [8. Changelog](#8-changelog)
|
46
|
+
- [9. Contributing](#9-contributing)
|
47
|
+
- [Contributors](#contributors)
|
48
|
+
- [Created by](#created-by)
|
49
|
+
- [Maintained by](#maintained-by)
|
50
|
+
- [Former maintainer](#former-maintainer)
|
51
|
+
- [10. Other Language Plugins](#10-other-language-plugins)
|
41
52
|
|
42
53
|
## 1. Current Release Notice
|
43
54
|
|
44
|
-
1.
|
45
|
-
|
46
|
-
Users that update from older versions to 1.4.0 or newer must change their `_config.yml` for the plugin to be loaded. Please see the `Installation` section bellow for the new string used to load the plugin.
|
47
|
-
|
48
|
-
The plugin now works with Jekyll 3, but it's backward compatible with Jekyll 2.
|
49
|
-
Please note that it was only tested with Jekyll 2.5.3 and 3.1.3.
|
55
|
+
1.6.0 is the current stable release.
|
50
56
|
|
51
57
|
The support for Octopress is dropped, but the plugin should still work with it since Octopress core is Jekyll.
|
52
58
|
Octopress 3 now has its own multi languages plugin: https://github.com/octopress/multilingual
|
@@ -54,7 +60,6 @@ Octopress 3 now has its own multi languages plugin: https://github.com/octopress
|
|
54
60
|
|
55
61
|
|
56
62
|
## 2. Features
|
57
|
-
* Works with Jekyll 2.5.3 and 3.1.3
|
58
63
|
* Supports multiple languages with the same code base.
|
59
64
|
* Supports all template languages that your Liquid pipeline supports.
|
60
65
|
* Uses [Liquid tags](https://github.com/Shopify/liquid) in your HTML for including translated strings.
|
@@ -83,10 +88,10 @@ And then execute: `$ bundle install`
|
|
83
88
|
|
84
89
|
Or install it yourself as: `$ gem install jekyll-multiple-languages-plugin`
|
85
90
|
|
86
|
-
To activate the plugin add it to the Jekyll `_config.yml` file, under the `
|
91
|
+
To activate the plugin add it to the Jekyll `_config.yml` file, under the `plugins` option:
|
87
92
|
|
88
93
|
```ruby
|
89
|
-
|
94
|
+
plugins:
|
90
95
|
- jekyll-multiple-languages-plugin
|
91
96
|
```
|
92
97
|
See the [Jekyll configuration documentation](http://jekyllrb.com/docs/configuration) for details.
|
@@ -173,7 +178,7 @@ pages:
|
|
173
178
|
work: Work
|
174
179
|
```
|
175
180
|
|
176
|
-
To access the `english` key, use one of these
|
181
|
+
To access the `english` key, use one of these tags:
|
177
182
|
|
178
183
|
```liquid
|
179
184
|
{% t global.english %}
|
@@ -181,7 +186,7 @@ or
|
|
181
186
|
{% translate global.english %}
|
182
187
|
```
|
183
188
|
|
184
|
-
You can also access translated strings by
|
189
|
+
You can also access translated strings by accessing the `site.translations` hash, this allows you to loop through your translations within Liquid:
|
185
190
|
|
186
191
|
```liquid
|
187
192
|
{% for item in site.translations[site.lang]["my_nested_yaml_collection"] %}
|
@@ -326,7 +331,9 @@ Inside each of the language folders, you should create mirror pages to provide t
|
|
326
331
|
### 5.7. Creating posts
|
327
332
|
There are no global posts. The posts are localized by language. And your posts will live in the `_i18n/[lang]/_posts` directory. So if, for example, you have English language on your website you should put your posts on `_i18n/en/_posts` directory.
|
328
333
|
|
334
|
+
## 6. License
|
329
335
|
|
336
|
+
This project is available under the [MIT License](LICENSE.txt).
|
330
337
|
|
331
338
|
## 7. Example website
|
332
339
|
|
@@ -361,8 +368,12 @@ permalink: /about/
|
|
361
368
|
Then, create a file named `about.md` under `_i18n/en` with the English content. Repeat this for the other languages (_i18n/es/about.md ...). When running the website, visit the address `http://localhost:4000/about` to see the English version, `http://localhost:4000/es/about` for the Spanish one, etc.
|
362
369
|
|
363
370
|
|
364
|
-
|
365
371
|
## 8. Changelog
|
372
|
+
* 1.6.1
|
373
|
+
* Improved testing
|
374
|
+
* Support for Jekyll 4
|
375
|
+
* Russian examples
|
376
|
+
* Translations rebuilt every time page is reloaded in developer mode
|
366
377
|
* 1.6.0
|
367
378
|
* fix: check if static_file_r_path is set
|
368
379
|
* Missing slash before lang prefix in lang picker example
|
@@ -446,29 +457,28 @@ Then, create a file named `about.md` under `_i18n/en` with the English content.
|
|
446
457
|
| [@leoditommaso](https://github.com/leoditommaso) | update the example page |
|
447
458
|
|
448
459
|
### Created by
|
449
|
-
[@kurtsson](https://github.com/kurtsson) from [
|
450
|
-
|
460
|
+
[@kurtsson](https://github.com/kurtsson) from [Daresay](https://github.com/daresaydigital) (https://daresay.co)
|
451
461
|
|
452
462
|
### Maintained by
|
453
|
-
- [@
|
463
|
+
- [@shushugah](https://github.com/shushugah)
|
464
|
+
|
465
|
+
### Former maintainer
|
454
466
|
- [@Anthony-Gaudino](https://github.com/Anthony-Gaudino)
|
455
467
|
|
456
468
|
|
457
469
|
|
458
470
|
## 10. Other Language Plugins
|
459
|
-
|
471
|
+
Below is a list of other language plugins for Jekyll (2019/06/27):
|
460
472
|
|
461
473
|
**Seems to be maintained:**
|
462
|
-
|
463
|
-
* [Jekyll Language Plugin](https://github.com/vwochnik/jekyll-language-plugin)
|
464
474
|
* [Polyglot](https://github.com/untra/polyglot)
|
465
|
-
* [Jekyll
|
466
|
-
* [Octopress Multilingual](https://github.com/octopress/multilingual)
|
467
|
-
* [jekyll-i18n_tags](https://github.com/KrzysiekJ/jekyll-i18n_tags)
|
475
|
+
* [Jekyll Language Plugin](https://github.com/vwochnik/jekyll-language-plugin)
|
468
476
|
* [jekyll-task-i18n](https://github.com/ruby-gettext/jekyll-task-i18n)
|
469
477
|
|
470
478
|
**Seems to be unmaintained / abandoned:**
|
471
|
-
|
479
|
+
* [jekyll-i18n_tags](https://github.com/KrzysiekJ/jekyll-i18n_tags)
|
480
|
+
* [Octopress Multilingual](https://github.com/octopress/multilingual)
|
481
|
+
* [Jekyll Multiple Languages](https://github.com/liaohuqiu/jekyll-multiple-languages)
|
472
482
|
* [Jekyll-Multilingualism](https://github.com/aleiphoenix/jekyll-multilingualism)
|
473
483
|
* [Jekyll::Languages](https://github.com/janlindblom/jekyll-languages)
|
474
484
|
* [Jekyll I18n support](https://github.com/hendricius/jekyll-i18n)
|
@@ -21,10 +21,8 @@ module Jekyll
|
|
21
21
|
#*****************************************************************************
|
22
22
|
Jekyll::Hooks.register :site, :pre_render do |site, payload|
|
23
23
|
lang = site.config['lang']
|
24
|
-
|
25
|
-
|
26
|
-
site.parsed_translations[lang] = YAML.load_file("#{site.source}/_i18n/#{lang}.yml")
|
27
|
-
end
|
24
|
+
puts "Loading translation from file #{site.source}/_i18n/#{lang}.yml"
|
25
|
+
site.parsed_translations[lang] = YAML.load_file("#{site.source}/_i18n/#{lang}.yml")
|
28
26
|
end
|
29
27
|
Jekyll::Hooks.register :site, :post_render do |site, payload|
|
30
28
|
|
@@ -191,11 +189,14 @@ module Jekyll
|
|
191
189
|
|
192
190
|
|
193
191
|
|
194
|
-
|
195
|
-
#
|
196
|
-
|
197
|
-
|
198
|
-
|
192
|
+
#-----------------------------------------------------------------------------
|
193
|
+
#
|
194
|
+
# Include (with priority—prepend)the translated
|
195
|
+
# permanent link for Page and document
|
196
|
+
#
|
197
|
+
#-----------------------------------------------------------------------------
|
198
|
+
|
199
|
+
module Permalink
|
199
200
|
#======================================
|
200
201
|
# permalink
|
201
202
|
#======================================
|
@@ -212,6 +213,8 @@ module Jekyll
|
|
212
213
|
end
|
213
214
|
end
|
214
215
|
|
216
|
+
Page.prepend(Permalink)
|
217
|
+
Document.prepend(Permalink)
|
215
218
|
|
216
219
|
|
217
220
|
##############################################################################
|
@@ -445,6 +448,9 @@ module Jekyll
|
|
445
448
|
baseurl = baseurl + "/" + lang
|
446
449
|
end
|
447
450
|
|
451
|
+
collections = site.collections.values.collect{|x| x.docs}.flatten
|
452
|
+
pages = site.pages + collections
|
453
|
+
|
448
454
|
for p in pages
|
449
455
|
unless p['namespace'].nil?
|
450
456
|
page_namespace = p['namespace']
|
@@ -504,4 +510,3 @@ Liquid::Template.register_tag('tf', Jekyll::Tags::LocalizeInclude)
|
|
504
510
|
Liquid::Template.register_tag('translate_file', Jekyll::Tags::LocalizeInclude)
|
505
511
|
Liquid::Template.register_tag('tl', Jekyll::LocalizeLink )
|
506
512
|
Liquid::Template.register_tag('translate_link', Jekyll::LocalizeLink )
|
507
|
-
|
data/lib/plugin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-multiple-languages-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Kurtsson
|
8
|
+
- Yonatan Miller
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2020-02-14 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
@@ -16,14 +17,28 @@ dependencies:
|
|
16
17
|
requirements:
|
17
18
|
- - "~>"
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
+
version: 2.0.1
|
20
21
|
type: :development
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
25
|
- - "~>"
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
+
version: 2.0.1
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: html-proofer
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
27
42
|
- !ruby/object:Gem::Dependency
|
28
43
|
name: rake
|
29
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,7 +62,7 @@ dependencies:
|
|
47
62
|
version: '2.0'
|
48
63
|
- - "<"
|
49
64
|
- !ruby/object:Gem::Version
|
50
|
-
version: '
|
65
|
+
version: '5.0'
|
51
66
|
type: :runtime
|
52
67
|
prerelease: false
|
53
68
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,12 +72,12 @@ dependencies:
|
|
57
72
|
version: '2.0'
|
58
73
|
- - "<"
|
59
74
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
75
|
+
version: '5.0'
|
61
76
|
description: Plugin for Jekyll 2.x and 3.x that adds support for translated keys,
|
62
77
|
templates and posts.
|
63
78
|
email:
|
64
79
|
- martin.kurtsson@daresay.co
|
65
|
-
-
|
80
|
+
- yonatan@shushugah.com
|
66
81
|
executables: []
|
67
82
|
extensions: []
|
68
83
|
extra_rdoc_files:
|
@@ -73,7 +88,7 @@ files:
|
|
73
88
|
- README.md
|
74
89
|
- lib/jekyll-multiple-languages-plugin.rb
|
75
90
|
- lib/plugin/version.rb
|
76
|
-
homepage: https://github.com/
|
91
|
+
homepage: https://github.com/kurtsson/jekyll-multiple-languages-plugin/
|
77
92
|
licenses:
|
78
93
|
- MIT
|
79
94
|
metadata: {}
|
@@ -93,8 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
108
|
- !ruby/object:Gem::Version
|
94
109
|
version: '0'
|
95
110
|
requirements: []
|
96
|
-
|
97
|
-
rubygems_version: 2.7.6
|
111
|
+
rubygems_version: 3.0.3
|
98
112
|
signing_key:
|
99
113
|
specification_version: 4
|
100
114
|
summary: I18n plugin for Jekyll
|