jekyll-multiple-languages-plugin 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +251 -78
- data/README.md +197 -59
- data/lib/jekyll-multiple-languages-plugin.rb +445 -0
- data/lib/plugin/version.rb +6 -0
- metadata +33 -39
- data/.gitignore +0 -21
- data/Gemfile +0 -4
- data/Rakefile +0 -1
- data/example/Gemfile +0 -4
- data/example/LICENSE +0 -21
- data/example/README.md +0 -11
- data/example/_config.yml +0 -8
- data/example/_i18n/en.yml +0 -10
- data/example/_i18n/en/_posts/2013-12-09-example-post.md +0 -15
- data/example/_i18n/en/footer.md +0 -2
- data/example/_i18n/es.yml +0 -10
- data/example/_i18n/es/_posts/2013-12-09-example-post.md +0 -15
- data/example/_i18n/es/footer.md +0 -2
- data/example/_i18n/it.yml +0 -10
- data/example/_i18n/it/_posts/2013-12-09-example-post.md +0 -16
- data/example/_i18n/it/footer.md +0 -2
- data/example/_includes/post.html +0 -40
- data/example/_layouts/default.html +0 -60
- data/example/_layouts/post.html +0 -5
- data/example/_plugins/jekyll-multiple-languages-plugin.rb +0 -1
- data/example/css/main.css +0 -285
- data/example/css/responsive.css +0 -92
- data/example/css/syntax.css +0 -60
- data/example/favicon.ico +0 -0
- data/example/images/cover.jpg +0 -0
- data/example/images/logo.png +0 -0
- data/example/images/sidebar-button.png +0 -0
- data/example/index.html +0 -8
- data/example/scripts/responsive.js +0 -14
- data/jekyll-multiple-languages-plugin.gemspec +0 -23
- data/lib/jekyll/multiple/languages/plugin.rb +0 -208
- data/lib/jekyll/multiple/languages/plugin/version.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebca470a5b53c6e49fe68d0ea6f33a184a2fb00c
|
4
|
+
data.tar.gz: b16152c945c2ac274e5bd64b04a27163676e88ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9767916b3dd6d5c04c6428b2f7f2ef2b09cefa9aefb3a689a44b125fb14f428bb4cb61c253177c3e573f94e73dee61aeee0105c8918c92e4e265201c85fb34c
|
7
|
+
data.tar.gz: e897ed85cf506f73815adf6a174c922a1939dd255795d505a91d86089546bbb84cf2bfa527f6b9a5434a46392dfb248438005158a087d9ea3cb3d2794c0ab6d1
|
data/LICENSE.txt
CHANGED
@@ -1,180 +1,353 @@
|
|
1
|
-
Mozilla Public License
|
2
|
-
|
1
|
+
Mozilla Public License Version 2.0
|
2
|
+
==================================
|
3
3
|
|
4
4
|
1. Definitions
|
5
|
+
--------------
|
5
6
|
|
6
|
-
1.1.
|
7
|
-
means
|
7
|
+
1.1. "Contributor"
|
8
|
+
means each individual or legal entity that creates, contributes to the
|
9
|
+
creation of, or owns Covered Software.
|
8
10
|
|
9
|
-
1.2.
|
10
|
-
means
|
11
|
+
1.2. "Contributor Version"
|
12
|
+
means the combination of the Contributions of others (if any) used by a
|
13
|
+
Contributor and that particular Contributor's Contribution.
|
11
14
|
|
12
|
-
1.3.
|
13
|
-
means Covered Software of a particular Contributor.
|
15
|
+
1.3. "Contribution"
|
16
|
+
means Covered Software of a particular Contributor.
|
14
17
|
|
15
|
-
1.4.
|
16
|
-
means
|
18
|
+
1.4. "Covered Software"
|
19
|
+
means Source Code Form to which the initial Contributor has attached the
|
20
|
+
notice in Exhibit A, the Executable Form of such Source Code Form, and
|
21
|
+
Modifications of such Source Code Form, in each case including portions
|
22
|
+
thereof.
|
17
23
|
|
18
|
-
1.5.
|
19
|
-
means
|
24
|
+
1.5. "Incompatible With Secondary Licenses"
|
25
|
+
means
|
20
26
|
|
21
|
-
that
|
27
|
+
(a) that the initial Contributor has attached the notice described in
|
28
|
+
Exhibit B to the Covered Software; or
|
22
29
|
|
23
|
-
that
|
30
|
+
(b) that the Covered Software was made available under the terms of version
|
31
|
+
1.1 or earlier of the License, but not also under the terms of a
|
32
|
+
Secondary License.
|
24
33
|
|
25
|
-
1.6.
|
26
|
-
means any form of the work other than Source Code Form.
|
34
|
+
1.6. "Executable Form"
|
35
|
+
means any form of the work other than Source Code Form.
|
27
36
|
|
28
|
-
1.7.
|
29
|
-
means
|
37
|
+
1.7. "Larger Work"
|
38
|
+
means a work that combines Covered Software with other material, in a
|
39
|
+
separate file or files, that is not Covered Software.
|
30
40
|
|
31
|
-
1.8.
|
32
|
-
means this document.
|
41
|
+
1.8. "License"
|
42
|
+
means this document.
|
33
43
|
|
34
|
-
1.9.
|
35
|
-
means
|
44
|
+
1.9. "Licensable"
|
45
|
+
means having the right to grant, to the maximum extent possible, whether at
|
46
|
+
the time of the initial grant or subsequently, any and all of the rights
|
47
|
+
conveyed by this License.
|
36
48
|
|
37
|
-
1.10.
|
38
|
-
means any of the following:
|
49
|
+
1.10. "Modifications"
|
50
|
+
means any of the following:
|
39
51
|
|
40
|
-
any
|
52
|
+
(a) any file in Source Code Form that results from an addition to, deletion
|
53
|
+
from, or modification of the contents of Covered Software; or
|
41
54
|
|
42
|
-
any new file in Source Code Form that contains any Covered Software.
|
55
|
+
(b) any new file in Source Code Form that contains any Covered Software.
|
43
56
|
|
44
|
-
1.11.
|
45
|
-
means
|
57
|
+
1.11. "Patent Claims" of a Contributor
|
58
|
+
means any patent claim(s), including without limitation, method, process,
|
59
|
+
and apparatus claims, in any patent Licensable by such Contributor that
|
60
|
+
would be infringed, but for the grant of the License, by the making, using,
|
61
|
+
selling, offering for sale, having made, import, or transfer of either its
|
62
|
+
Contributions or its Contributor Version.
|
46
63
|
|
47
|
-
1.12.
|
48
|
-
means
|
64
|
+
1.12. "Secondary License"
|
65
|
+
means either the GNU General Public License, Version 2.0, the GNU Lesser
|
66
|
+
General Public License, Version 2.1, the GNU Affero General Public License,
|
67
|
+
Version 3.0, or any later versions of those licenses.
|
49
68
|
|
50
|
-
1.13.
|
51
|
-
means the form of the work preferred for making modifications.
|
69
|
+
1.13. "Source Code Form"
|
70
|
+
means the form of the work preferred for making modifications.
|
52
71
|
|
53
|
-
1.14.
|
54
|
-
means an individual or a legal entity exercising rights under this License.
|
72
|
+
1.14. "You" (or "Your")
|
73
|
+
means an individual or a legal entity exercising rights under this License.
|
74
|
+
For legal entities, "You" includes any entity that controls, is controlled
|
75
|
+
by, or is under common control with You. For purposes of this definition,
|
76
|
+
"control" means (a) the power, direct or indirect, to cause the direction or
|
77
|
+
management of such entity, whether by contract or otherwise, or (b)
|
78
|
+
ownership of more than fifty percent (50%) of the outstanding shares or
|
79
|
+
beneficial ownership of such entity.
|
55
80
|
|
56
81
|
2. License Grants and Conditions
|
82
|
+
--------------------------------
|
57
83
|
|
58
84
|
2.1. Grants
|
59
85
|
|
60
|
-
Each
|
86
|
+
Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive
|
87
|
+
license:
|
61
88
|
|
62
|
-
under
|
89
|
+
(a) under intellectual property rights (other than patent or trademark)
|
90
|
+
Licensable by such Contributor to use, reproduce, make available, modify,
|
91
|
+
display, perform, distribute, and otherwise exploit its Contributions,
|
92
|
+
either on an unmodified basis, with Modifications, or as part of a Larger
|
93
|
+
Work; and
|
63
94
|
|
64
|
-
under
|
95
|
+
(b) under Patent Claims of such Contributor to make, use, sell, offer for sale,
|
96
|
+
have made, import, and otherwise transfer either its Contributions or its
|
97
|
+
Contributor Version.
|
65
98
|
|
66
99
|
2.2. Effective Date
|
67
100
|
|
68
|
-
The
|
101
|
+
The licenses granted in Section 2.1 with respect to any Contribution become
|
102
|
+
effective for each Contribution on the date the Contributor first distributes
|
103
|
+
such Contribution.
|
69
104
|
|
70
105
|
2.3. Limitations on Grant Scope
|
71
106
|
|
72
|
-
The
|
107
|
+
The licenses granted in this Section 2 are the only rights granted under this
|
108
|
+
License. No additional rights or licenses will be implied from the distribution
|
109
|
+
or licensing of Covered Software under this License. Notwithstanding Section
|
110
|
+
2.1(b) above, no patent license is granted by a Contributor:
|
73
111
|
|
74
|
-
for any code that a Contributor has removed from Covered Software;
|
112
|
+
(a) for any code that a Contributor has removed from Covered Software;
|
113
|
+
or
|
75
114
|
|
76
|
-
for
|
115
|
+
(b) for infringements caused by: (i) Your and any other third party's
|
116
|
+
modifications of Covered Software, or (ii) the combination of its
|
117
|
+
Contributions with other software (except as part of its Contributor
|
118
|
+
Version); or
|
77
119
|
|
78
|
-
under
|
120
|
+
(c) under Patent Claims infringed by Covered Software in the absence of its
|
121
|
+
Contributions.
|
79
122
|
|
80
|
-
This
|
123
|
+
This License does not grant any rights in the trademarks, service marks, or
|
124
|
+
logos of any Contributor (except as may be necessary to comply with the notice
|
125
|
+
requirements in Section 3.4).
|
81
126
|
|
82
127
|
2.4. Subsequent Licenses
|
83
128
|
|
84
|
-
No
|
129
|
+
No Contributor makes additional grants as a result of Your choice to distribute
|
130
|
+
the Covered Software under a subsequent version of this License (see Section
|
131
|
+
10.2) or under the terms of a Secondary License (if permitted under the terms of
|
132
|
+
Section 3.3).
|
85
133
|
|
86
134
|
2.5. Representation
|
87
135
|
|
88
|
-
Each
|
136
|
+
Each Contributor represents that the Contributor believes its Contributions are
|
137
|
+
its original creation(s) or it has sufficient rights to grant the rights to its
|
138
|
+
Contributions conveyed by this License.
|
89
139
|
|
90
140
|
2.6. Fair Use
|
91
141
|
|
92
|
-
This
|
142
|
+
This License is not intended to limit any rights You have under applicable
|
143
|
+
copyright doctrines of fair use, fair dealing, or other equivalents.
|
93
144
|
|
94
145
|
2.7. Conditions
|
95
146
|
|
96
|
-
Sections
|
147
|
+
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
|
148
|
+
Section 2.1.
|
97
149
|
|
98
150
|
3. Responsibilities
|
151
|
+
-------------------
|
99
152
|
|
100
153
|
3.1. Distribution of Source Form
|
101
154
|
|
102
|
-
All
|
155
|
+
All distribution of Covered Software in Source Code Form, including any
|
156
|
+
Modifications that You create or to which You contribute, must be under the
|
157
|
+
terms of this License. You must inform recipients that the Source Code Form of
|
158
|
+
the Covered Software is governed by the terms of this License, and how they can
|
159
|
+
obtain a copy of this License. You may not attempt to alter or restrict the
|
160
|
+
recipients' rights in the Source Code Form.
|
103
161
|
|
104
162
|
3.2. Distribution of Executable Form
|
105
163
|
|
106
164
|
If You distribute Covered Software in Executable Form then:
|
107
165
|
|
108
|
-
such
|
166
|
+
(a) such Covered Software must also be made available in Source Code Form, as
|
167
|
+
described in Section 3.1, and You must inform recipients of the Executable
|
168
|
+
Form how they can obtain a copy of such Source Code Form by reasonable means
|
169
|
+
in a timely manner, at a charge no more than the cost of distribution to the
|
170
|
+
recipient; and
|
109
171
|
|
110
|
-
You
|
172
|
+
(b) You may distribute such Executable Form under the terms of this License, or
|
173
|
+
sublicense it under different terms, provided that the license for the
|
174
|
+
Executable Form does not attempt to limit or alter the recipients' rights in
|
175
|
+
the Source Code Form under this License.
|
111
176
|
|
112
177
|
3.3. Distribution of a Larger Work
|
113
178
|
|
114
|
-
You may create and distribute a Larger Work under terms of Your choice, provided
|
179
|
+
You may create and distribute a Larger Work under terms of Your choice, provided
|
180
|
+
that You also comply with the requirements of this License for the Covered
|
181
|
+
Software. If the Larger Work is a combination of Covered Software with a work
|
182
|
+
governed by one or more Secondary Licenses, and the Covered Software is not
|
183
|
+
Incompatible With Secondary Licenses, this License permits You to additionally
|
184
|
+
distribute such Covered Software under the terms of such Secondary License(s),
|
185
|
+
so that the recipient of the Larger Work may, at their option, further
|
186
|
+
distribute the Covered Software under the terms of either this License or such
|
187
|
+
Secondary License(s).
|
115
188
|
|
116
189
|
3.4. Notices
|
117
190
|
|
118
|
-
You
|
191
|
+
You may not remove or alter the substance of any license notices (including
|
192
|
+
copyright notices, patent notices, disclaimers of warranty, or limitations of
|
193
|
+
liability) contained within the Source Code Form of the Covered Software, except
|
194
|
+
that You may alter any license notices to the extent required to remedy known
|
195
|
+
factual inaccuracies.
|
119
196
|
|
120
197
|
3.5. Application of Additional Terms
|
121
198
|
|
122
|
-
You
|
199
|
+
You may choose to offer, and to charge a fee for, warranty, support, indemnity
|
200
|
+
or liability obligations to one or more recipients of Covered Software. However,
|
201
|
+
You may do so only on Your own behalf, and not on behalf of any Contributor. You
|
202
|
+
must make it absolutely clear that any such warranty, support, indemnity, or
|
203
|
+
liability obligation is offered by You alone, and You hereby agree to indemnify
|
204
|
+
every Contributor for any liability incurred by such Contributor as a result of
|
205
|
+
warranty, support, indemnity or liability terms You offer. You may include
|
206
|
+
additional disclaimers of warranty and limitations of liability specific to any
|
207
|
+
jurisdiction.
|
123
208
|
|
124
209
|
4. Inability to Comply Due to Statute or Regulation
|
210
|
+
---------------------------------------------------
|
125
211
|
|
126
|
-
If it is impossible for You to comply with any of the terms of this License with
|
212
|
+
If it is impossible for You to comply with any of the terms of this License with
|
213
|
+
respect to some or all of the Covered Software due to statute, judicial order,
|
214
|
+
or regulation then You must: (a) comply with the terms of this License to the
|
215
|
+
maximum extent possible; and (b) describe the limitations and the code they
|
216
|
+
affect. Such description must be placed in a text file included with all
|
217
|
+
distributions of the Covered Software under this License. Except to the extent
|
218
|
+
prohibited by statute or regulation, such description must be sufficiently
|
219
|
+
detailed for a recipient of ordinary skill to be able to understand it.
|
127
220
|
|
128
221
|
5. Termination
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
222
|
+
--------------
|
223
|
+
|
224
|
+
5.1. The rights granted under this License will terminate automatically if You
|
225
|
+
fail to comply with any of its terms. However, if You become compliant, then the
|
226
|
+
rights granted under this License from a particular Contributor are reinstated
|
227
|
+
(a) provisionally, unless and until such Contributor explicitly and finally
|
228
|
+
terminates Your grants, and (b) on an ongoing basis, if such Contributor fails
|
229
|
+
to notify You of the non-compliance by some reasonable means prior to 60 days
|
230
|
+
after You have come back into compliance. Moreover, Your grants from a
|
231
|
+
particular Contributor are reinstated on an ongoing basis if such Contributor
|
232
|
+
notifies You of the non-compliance by some reasonable means, this is the first
|
233
|
+
time You have received notice of non-compliance with this License from such
|
234
|
+
Contributor, and You become compliant prior to 30 days after Your receipt of the
|
235
|
+
notice.
|
236
|
+
|
237
|
+
5.2. If You initiate litigation against any entity by asserting a patent
|
238
|
+
infringement claim (excluding declaratory judgment actions, counter-claims, and
|
239
|
+
cross-claims) alleging that a Contributor Version directly or indirectly
|
240
|
+
infringes any patent, then the rights granted to You by any and all Contributors
|
241
|
+
for the Covered Software under Section 2.1 of this License shall terminate.
|
242
|
+
|
243
|
+
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
|
244
|
+
license agreements (excluding distributors and resellers) which have been
|
245
|
+
validly granted by You or Your distributors under this License prior to
|
246
|
+
termination shall survive termination.
|
247
|
+
|
248
|
+
********************************************************************************
|
249
|
+
* *
|
250
|
+
* 6. Disclaimer of Warranty *
|
251
|
+
* ------------------------- *
|
252
|
+
* *
|
253
|
+
* Covered Software is provided under this License on an "as is" basis, *
|
254
|
+
* without warranty of any kind, either expressed, implied, or statutory, *
|
255
|
+
* including, without limitation, warranties that the Covered Software is *
|
256
|
+
* free of defects, merchantable, fit for a particular purpose or *
|
257
|
+
* non-infringing. The entire risk as to the quality and performance of the *
|
258
|
+
* Covered Software is with You. Should any Covered Software prove defective *
|
259
|
+
* in any respect, You (not any Contributor) assume the cost of any necessary *
|
260
|
+
* servicing, repair, or correction. This disclaimer of warranty constitutes *
|
261
|
+
* an essential part of this License. No use of any Covered Software is *
|
262
|
+
* authorized under this License except under this disclaimer. *
|
263
|
+
* *
|
264
|
+
********************************************************************************
|
265
|
+
|
266
|
+
********************************************************************************
|
267
|
+
* *
|
268
|
+
* 7. Limitation of Liability *
|
269
|
+
* -------------------------- *
|
270
|
+
* *
|
271
|
+
* Under no circumstances and under no legal theory, whether tort (including *
|
272
|
+
* negligence), contract, or otherwise, shall any Contributor, or anyone who *
|
273
|
+
* distributes Covered Software as permitted above, be liable to You for any *
|
274
|
+
* direct, indirect, special, incidental, or consequential damages of any *
|
275
|
+
* character including, without limitation, damages for lost profits, loss of *
|
276
|
+
* goodwill, work stoppage, computer failure or malfunction, or any and all *
|
277
|
+
* other commercial damages or losses, even if such party shall have been *
|
278
|
+
* informed of the possibility of such damages. This limitation of liability *
|
279
|
+
* shall not apply to liability for death or personal injury resulting from *
|
280
|
+
* such party's negligence to the extent applicable law prohibits such *
|
281
|
+
* limitation. Some jurisdictions do not allow the exclusion or limitation of *
|
282
|
+
* incidental or consequential damages, so this exclusion and limitation may *
|
283
|
+
* not apply to You. *
|
284
|
+
* *
|
285
|
+
********************************************************************************
|
143
286
|
|
144
287
|
8. Litigation
|
288
|
+
-------------
|
145
289
|
|
146
|
-
Any
|
290
|
+
Any litigation relating to this License may be brought only in the courts of a
|
291
|
+
jurisdiction where the defendant maintains its principal place of business and
|
292
|
+
such litigation shall be governed by laws of that jurisdiction, without
|
293
|
+
reference to its conflict-of-law provisions. Nothing in this Section shall
|
294
|
+
prevent a party's ability to bring cross-claims or counter-claims.
|
147
295
|
|
148
296
|
9. Miscellaneous
|
297
|
+
----------------
|
149
298
|
|
150
|
-
This
|
299
|
+
This License represents the complete agreement concerning the subject matter
|
300
|
+
hereof. If any provision of this License is held to be unenforceable, such
|
301
|
+
provision shall be reformed only to the extent necessary to make it enforceable.
|
302
|
+
Any law or regulation which provides that the language of a contract shall be
|
303
|
+
construed against the drafter shall not be used to construe this License against
|
304
|
+
a Contributor.
|
151
305
|
|
152
306
|
10. Versions of the License
|
307
|
+
---------------------------
|
153
308
|
|
154
309
|
10.1. New Versions
|
155
310
|
|
156
|
-
Mozilla
|
311
|
+
Mozilla Foundation is the license steward. Except as provided in Section 10.3,
|
312
|
+
no one other than the license steward has the right to modify or publish new
|
313
|
+
versions of this License. Each version will be given a distinguishing version
|
314
|
+
number.
|
157
315
|
|
158
316
|
10.2. Effect of New Versions
|
159
317
|
|
160
|
-
You
|
318
|
+
You may distribute the Covered Software under the terms of the version of the
|
319
|
+
License under which You originally received the Covered Software, or under the
|
320
|
+
terms of any subsequent version published by the license steward.
|
161
321
|
|
162
322
|
10.3. Modified Versions
|
163
323
|
|
164
|
-
If
|
324
|
+
If you create software not governed by this License, and you want to create a
|
325
|
+
new license for such software, you may create and use a modified version of this
|
326
|
+
License if you rename the license and remove any references to the name of the
|
327
|
+
license steward (except to note that such modified license differs from this
|
328
|
+
License).
|
165
329
|
|
166
330
|
10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
|
167
331
|
|
168
|
-
If You choose to distribute Source Code Form that is Incompatible With Secondary
|
332
|
+
If You choose to distribute Source Code Form that is Incompatible With Secondary
|
333
|
+
Licenses under the terms of this version of the License, the notice described in
|
334
|
+
Exhibit B of this License must be attached.
|
169
335
|
|
170
336
|
Exhibit A - Source Code Form License Notice
|
337
|
+
-------------------------------------------
|
171
338
|
|
172
|
-
This
|
339
|
+
This Source Code Form is subject to the terms of the Mozilla Public License,
|
340
|
+
v. 2.0. If a copy of the MPL was not distributed with this file, You can
|
341
|
+
obtain one at http://mozilla.org/MPL/2.0/.
|
173
342
|
|
174
|
-
If
|
343
|
+
If it is not possible or desirable to put the notice in a particular file, then
|
344
|
+
You may include the notice in a location (such as a LICENSE file in a relevant
|
345
|
+
directory) where a recipient would be likely to look for such a notice.
|
175
346
|
|
176
347
|
You may add additional accurate notices of copyright ownership.
|
177
348
|
|
178
|
-
Exhibit B -
|
349
|
+
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
350
|
+
---------------------------------------------------------
|
179
351
|
|
180
|
-
This Source Code Form is
|
352
|
+
This Source Code Form is "Incompatible With Secondary Licenses", as defined by
|
353
|
+
the Mozilla Public License, v. 2.0.
|
data/README.md
CHANGED
@@ -1,13 +1,45 @@
|
|
1
|
-
# Multiple Languages
|
1
|
+
# Jekyll Multiple Languages Plugin
|
2
2
|
|
3
|
-
Jekyll Multiple Languages is an internationalization plugin for [Jekyll](https://github.com/mojombo/jekyll). It compiles your Jekyll site for one or more languages with a similar approach as Rails does. The different sites will be stored in sub folders with the same name as the language it contains.
|
3
|
+
Jekyll Multiple Languages is an internationalization plugin for [Jekyll](https://github.com/mojombo/jekyll). It compiles your Jekyll site for one or more languages with a similar approach as Rails does. The different sites will be stored in sub folders with the same name as the language it contains.
|
4
4
|
|
5
|
-
The plugin
|
6
|
-
|
7
|
-
##Installation
|
5
|
+
The plugin was developed as an utility at [Screen Interaction](http://www.screeninteraction.com)
|
8
6
|
|
9
7
|
### Gem [![Gem Version](https://badge.fury.io/rb/jekyll-multiple-languages-plugin.png)](http://badge.fury.io/rb/jekyll-multiple-languages-plugin)
|
10
8
|
|
9
|
+
|
10
|
+
|
11
|
+
## Current Relese Notice
|
12
|
+
|
13
|
+
1.4.0 is the current stable release.
|
14
|
+
|
15
|
+
Users that update from older versions to 1.4.0 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.
|
16
|
+
|
17
|
+
The plugin now works with Jekyll 3, but it's backwards compatible with Jekyll 2.
|
18
|
+
Please note that it was only tested with Jekyll 2.5.3 and 3.1.3.
|
19
|
+
|
20
|
+
The support for Octopress is dropped, but the plugin still should work with it since Octopress core is Jekyll.
|
21
|
+
Octopress 3 now has it's own multi languages plugin: https://github.com/octopress/multilingual
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
## Features
|
26
|
+
* Works with Jekyll 2.5.3 and 3.1.3
|
27
|
+
* Supports multiple languages with the same code base.
|
28
|
+
* Supports all template languages that your Liquid pipeline supports.
|
29
|
+
* Uses [Liquid tags](https://github.com/Shopify/liquid) in your HTML for including translated strings.
|
30
|
+
* Compiles the site multiple times for all supported languages into separate subfolders.
|
31
|
+
* Works with the --watch flag turned on and will rebuild all languages automatically.
|
32
|
+
* Contains an example web site thanks to [@davrandom](https://github.com/davrandom/)
|
33
|
+
* Supports translated keys in YAML format
|
34
|
+
* Supports translated template files
|
35
|
+
* Supports translated links
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
## Installation
|
40
|
+
|
41
|
+
### Using the gem
|
42
|
+
|
11
43
|
This plugin is available as a Rubygem, https://rubygems.org/gems/jekyll-multiple-languages-plugin.
|
12
44
|
|
13
45
|
Add this line to your application's Gemfile:
|
@@ -16,20 +48,26 @@ Add this line to your application's Gemfile:
|
|
16
48
|
gem 'jekyll-multiple-languages-plugin'
|
17
49
|
```
|
18
50
|
|
19
|
-
And then execute: `$ bundle`
|
51
|
+
And then execute: `$ bundle install`
|
20
52
|
|
21
53
|
Or install it yourself as: `$ gem install jekyll-multiple-languages-plugin`
|
22
54
|
|
23
|
-
To activate the plugin add
|
55
|
+
To activate the plugin add it to the Jekyll `_config.yml` file, under the `gems` option:
|
24
56
|
|
25
57
|
```ruby
|
26
|
-
|
58
|
+
gems:
|
59
|
+
- jekyll-multiple-languages-plugin
|
27
60
|
```
|
61
|
+
See the [Jekyll configuration documentation](http://jekyllrb.com/docs/configuration) for details.
|
28
62
|
|
63
|
+
### Manually
|
64
|
+
1. Download the repository with Git or your preferred method.
|
65
|
+
2. Inside your Jekyll `_plugins` folder create a new folder called `jekyll-multiple-languages-plugin`.
|
66
|
+
3. Copy or link the directory `lib`, that is inside the downloaded repository, into your `_plugins/jekyll-multiple-languages-plugin` folder of your Jekyll project.
|
29
67
|
|
30
|
-
### Submodule
|
31
|
-
|
32
|
-
manage your plugins by utilizing git submodules.
|
68
|
+
### As a Git Submodule
|
69
|
+
|
70
|
+
If your Jekyll project is in a git repository, you can easily manage your plugins by utilizing git submodules.
|
33
71
|
|
34
72
|
To install this plugin as a git submodule:
|
35
73
|
|
@@ -45,24 +83,10 @@ $ git pull origin master
|
|
45
83
|
```
|
46
84
|
|
47
85
|
|
48
|
-
### Copy file
|
49
|
-
Copy or link the file `lib/jekyll/multiple/languages/plugin.rb` into your `_plugins` folder for your Jekyll project.
|
50
|
-
|
51
|
-
|
52
|
-
##Features
|
53
|
-
* Supports multiple languages with the same code base.
|
54
|
-
* Supports all template languages that your Liquid pipeline supports.
|
55
|
-
* Uses [Liquid tags](https://github.com/Shopify/liquid) in your HTML for including translated strings.
|
56
|
-
* Compiles the site multiple times for all supported languages into separate subfolders.
|
57
|
-
* The plugin even works with the -watch flag turned on and will rebuild all languages automatically.
|
58
|
-
* Contains an example web site thanks to [@davrandom](https://github.com/davrandom/)
|
59
|
-
* Supports translated keys in YAML format
|
60
|
-
* Supports translated template files
|
61
|
-
|
62
86
|
|
63
|
-
##
|
64
|
-
###
|
65
|
-
Add the
|
87
|
+
## Configuration
|
88
|
+
### _config.yml
|
89
|
+
Add the languages available in your website into your _config.yml (obligatory):
|
66
90
|
|
67
91
|
```yaml
|
68
92
|
languages: ["sv", "en", "de", "fr"]
|
@@ -70,19 +94,19 @@ languages: ["sv", "en", "de", "fr"]
|
|
70
94
|
|
71
95
|
The first language in the array will be the default language, English, German and French will be added in to separate subfolders.
|
72
96
|
|
73
|
-
To avoid redundancy, it is possible to exclude files and folders from
|
97
|
+
To avoid redundancy, it is possible to exclude files and folders from being copied to the localization folders.
|
74
98
|
|
75
99
|
```yaml
|
76
100
|
exclude_from_localizations: ["javascript", "images", "css"]
|
77
101
|
```
|
78
|
-
In code these specific files should be referenced via `baseurl_root`. E.g.
|
102
|
+
In code, these specific files should be referenced via `baseurl_root`. E.g.
|
79
103
|
|
80
104
|
```
|
81
105
|
<link rel="stylesheet" href="{{ "/css/bootstrap.css" | prepend: site.baseurl_root }}"/>
|
82
106
|
```
|
83
107
|
|
84
|
-
###
|
85
|
-
Create
|
108
|
+
### Folder structure
|
109
|
+
Create a folder called `_i18n` and add sub-folders for each language, using the same names used on the `languages` setting on the `_config.yml`:
|
86
110
|
|
87
111
|
- /_i18n/sv.yml
|
88
112
|
- /_i18n/en.yml
|
@@ -93,7 +117,11 @@ Create this folder structure in your Jekyll project as an example:
|
|
93
117
|
- /_i18n/de/pagename/blockname.md
|
94
118
|
- /_i18n/fr/pagename/blockname.md
|
95
119
|
|
96
|
-
|
120
|
+
|
121
|
+
|
122
|
+
## Usage
|
123
|
+
### Translating strings
|
124
|
+
To add a translated string into your web page use one of these liquid tags:
|
97
125
|
|
98
126
|
```liquid
|
99
127
|
{% t key %}
|
@@ -101,7 +129,7 @@ or
|
|
101
129
|
{% translate key %}
|
102
130
|
```
|
103
131
|
|
104
|
-
|
132
|
+
This will pick the correct string from the `language.yml` file during compilation.
|
105
133
|
|
106
134
|
The language.yml files are written in YAML syntax which caters for a simple grouping of strings.
|
107
135
|
|
@@ -114,7 +142,7 @@ pages:
|
|
114
142
|
work: Work
|
115
143
|
```
|
116
144
|
|
117
|
-
To access the english key, use
|
145
|
+
To access the english key, use one of these tag:
|
118
146
|
|
119
147
|
```liquid
|
120
148
|
{% t global.english %}
|
@@ -122,7 +150,8 @@ or
|
|
122
150
|
{% translate global.english %}
|
123
151
|
```
|
124
152
|
|
125
|
-
|
153
|
+
### Including translated files
|
154
|
+
The plugin also supports using different markdown files for different languages using the liquid tag:
|
126
155
|
|
127
156
|
```liquid
|
128
157
|
{% tf pagename/blockname.md %}
|
@@ -130,15 +159,47 @@ or
|
|
130
159
|
{% translate_file pagename/blockname.md %}
|
131
160
|
```
|
132
161
|
|
133
|
-
This plugin have exactly the same support and syntax as the built in
|
162
|
+
This plugin have exactly the same support and syntax as the Jekyll's built in liquid tag:
|
134
163
|
|
135
164
|
```liquid
|
136
165
|
{% include file %}
|
137
166
|
```
|
138
167
|
|
139
|
-
|
168
|
+
so plugins that extends its functionality should be picked up by this plugin as well.
|
169
|
+
|
170
|
+
### Permalinks and Translating Links
|
171
|
+
To use localized pages with permalinks, you must provide a defalt permalink `permalink` and the language specific permalinks, for example, `permalink_fr` for French.
|
172
|
+
|
173
|
+
To translate links, you must also add a **unique namespace** on the YAML front matter along with the permalinks.
|
174
|
+
|
175
|
+
Example:
|
140
176
|
|
141
|
-
|
177
|
+
```yaml
|
178
|
+
---
|
179
|
+
layout: default
|
180
|
+
|
181
|
+
namespace: team
|
182
|
+
|
183
|
+
permalink: /team/
|
184
|
+
permalink_fr: /equipe/
|
185
|
+
---
|
186
|
+
```
|
187
|
+
|
188
|
+
And then you can use the translate link liquid tag like this:
|
189
|
+
|
190
|
+
```liquid
|
191
|
+
<a href="{% tl team %}"> <!--This link will return /team if we are in the english version of the website and /fr/equipe if it's the french version</a>-->
|
192
|
+
|
193
|
+
<a href="{% tl team fr %}"> <!--This link will always return /fr/equipe</a>-->
|
194
|
+
|
195
|
+
or the longer version:
|
196
|
+
|
197
|
+
<a href="{% translate_link team %}"> <!--This link will return /team if we are in the english version of the website and /fr/equipe if it's the french version</a>-->
|
198
|
+
|
199
|
+
<a href="{% translate_link team fr %}"> <!--This link will always return /fr/equipe</a>-->
|
200
|
+
```
|
201
|
+
|
202
|
+
### i18n in templates
|
142
203
|
Sometimes it is convenient to add keys even in template files. This works in the exact same way as in ordinary files, however sometimes it can be useful to include different string in different pages even if they use the same template.
|
143
204
|
|
144
205
|
A perfect example is this:
|
@@ -167,7 +228,9 @@ titles:
|
|
167
228
|
home: "Home"
|
168
229
|
```
|
169
230
|
|
170
|
-
|
231
|
+
|
232
|
+
|
233
|
+
### Link between languages
|
171
234
|
This plugin gives you the variables
|
172
235
|
|
173
236
|
```liquid
|
@@ -185,28 +248,89 @@ This allows you to create solutions like this:
|
|
185
248
|
|
186
249
|
``` liquid
|
187
250
|
{% if site.lang == "sv" %}
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
251
|
+
{% capture link1 %}{{ site.baseurl_root }}en{{ page.url}}{% endcapture %}
|
252
|
+
<a href="{{ link1 }}" >{% t global.english %}</a>
|
253
|
+
{% elsif site.lang == "en" %}
|
254
|
+
{% capture link2 %}{{ site.baseurl_root }}{{ page.url }}{% endcapture %}
|
255
|
+
<a href="{{ link2 }}" >{% t global.swedish %}</a>
|
256
|
+
{% endif %}
|
194
257
|
```
|
195
258
|
|
196
259
|
This snippet will create a link that will toggle between Swedish and English. A more detailed description of the variables used follows:
|
197
260
|
|
198
|
-
| Name
|
199
|
-
|
|
200
|
-
| site.lang
|
201
|
-
| site.baseurl
|
202
|
-
| site.baseurl_root | Points to the root of the page without the language path
|
203
|
-
| page.url
|
261
|
+
| Name | Value | Example |
|
262
|
+
| ----------------: | :------------------------------------------------------------ | :------------------------- |
|
263
|
+
| site.lang | The language used in the current compilation stage | ``` en ``` |
|
264
|
+
| site.baseurl | Points to the root of the site including the current language | ``` http://foo.bar/en ``` |
|
265
|
+
| site.baseurl_root | Points to the root of the page without the language path | ``` http://foo.bar ``` |
|
266
|
+
| page.url | The current page's relative URL to the baseurl | ``` /a/sub/folder/page/ ```|
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
### Creating pages
|
271
|
+
Depending on the theme, or your preferences, you need to create a "template" page at the root folder or in a folder (ex. `_pages`). Inside each page (in this example an `about.md`) you should have at least the following in the header and body:
|
272
|
+
|
273
|
+
```yaml
|
274
|
+
---
|
275
|
+
layout: page
|
276
|
+
title: About
|
277
|
+
permalink: /about/
|
278
|
+
---
|
279
|
+
|
280
|
+
{% translate_file about/about.md %}
|
281
|
+
```
|
282
|
+
|
283
|
+
Inside each of the language folders, you should create mirror pages to provide the actual content for that language (ex. `i18n/es/about/about.md`). Make sure to erase the headers from those md files, or else your site will break.
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
## Example website
|
288
|
+
|
289
|
+
This repository has an example website where you can test the plugin.
|
290
|
+
After downloading the repository, get into the `example` directory and run: `bundle install` to install the newest version of Jekyll (change the Gemfile to install another version), the plugin, and all other dependencies.
|
291
|
+
|
292
|
+
Then run `bundle exec jekyll serve` to start the Jekyll server. Using your web browser, access the address `http://localhost:4000`.
|
293
|
+
|
294
|
+
### Adding a new language
|
295
|
+
|
296
|
+
Imagine you want to add German pages on the test website. First, add a the new language into the list of languages on `_config.yml`:
|
297
|
+
```ruby
|
298
|
+
languages: ["it", "en", "es", "de"]
|
299
|
+
```
|
300
|
+
|
301
|
+
Create a new folder for the language under the `_i18n` folder and add a markdown file containing the translation, just like on the other languages folders, and you're done.
|
302
|
+
|
303
|
+
### Adding new page
|
304
|
+
|
305
|
+
Let's say you want to create an about page for the example website, you will create an `about.html` page on the root of the website (same place as index.html), with this:
|
306
|
+
|
307
|
+
```
|
308
|
+
---
|
309
|
+
layout: page
|
310
|
+
title: About
|
311
|
+
permalink: /about/
|
312
|
+
---
|
313
|
+
|
314
|
+
{% translate_file about/about.md %}
|
315
|
+
```
|
316
|
+
|
317
|
+
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.
|
318
|
+
|
204
319
|
|
205
320
|
|
206
|
-
##Changelog
|
321
|
+
## Changelog
|
322
|
+
* 1.4.0
|
323
|
+
* Support for Jekyll 3, thanks to [@pedrocarmona](https://github.com/screeninteraction/jekyll-multiple-languages-plugin/pull/62)
|
324
|
+
* How to create pages documentation, thanks to [@elotroalex](https://github.com/screeninteraction/jekyll-multiple-languages-plugin/pull/57)
|
325
|
+
* Many bug fixes
|
326
|
+
* Code refactoring, cleanup and reorganization
|
327
|
+
* Files and folders reorganization
|
328
|
+
* Improved and fixed issues on the example website
|
329
|
+
* Inprovement and fixes on documentations
|
330
|
+
* Inproved license files
|
207
331
|
* 1.3.0
|
208
332
|
* Support for localized links and custom permalinks, thanks to [@jasonlemay](https://github.com/screeninteraction/jekyll-multiple-languages-plugin/pull/53)
|
209
|
-
* Support for excluding posts from translation, thanks to [ctruelson](https://github.com/screeninteraction/jekyll-multiple-languages-plugin/pull/51)
|
333
|
+
* Support for excluding posts from translation, thanks to [@ctruelson](https://github.com/screeninteraction/jekyll-multiple-languages-plugin/pull/51)
|
210
334
|
* 1.2.9
|
211
335
|
* Bug fix when excluding files from translation, again thanks to [@h6](https://github.com/H6)
|
212
336
|
* 1.2.8
|
@@ -247,8 +371,22 @@ This snippet will create a link that will toggle between Swedish and English. A
|
|
247
371
|
5. Create new Pull Request
|
248
372
|
|
249
373
|
### Contributors
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
374
|
+
| User | Contribution |
|
375
|
+
| :----------------------------------------------- | :----------------------------------- |
|
376
|
+
| [@pedrocarmona](https://github.com/pedrocarmona) | support for Jekyll 3 |
|
377
|
+
| [@elotroalex](https://github.com/elotroalex) | added a how to create page to README |
|
378
|
+
| [@jasonlemay](https://github.com/jasonlemay) | support for localized links |
|
379
|
+
| [@ctruelson](https://github.com/ctruelson) | support for excluding posts |
|
380
|
+
| [@Bersch](https://github.com/bersch) | better paths |
|
381
|
+
| [@Davrandom](https://github.com/davrandom) | plugin usage example |
|
382
|
+
| [@agramian](https://github.com/agramian) | fallback to default language |
|
383
|
+
| [@h6](https://github.com/H6) | exclude files from translation |
|
384
|
+
| [@leoditommaso](https://github.com/leoditommaso) | update the example page |
|
385
|
+
|
386
|
+
### Created by
|
387
|
+
[@kurtsson](https://github.com/kurtsson) from [Screen Interaction](https://github.com/screeninteraction) (http://screeninteraction.com)
|
388
|
+
|
389
|
+
|
390
|
+
### Maintained by
|
391
|
+
- [@kurtsson](https://github.com/kurtsson)
|
392
|
+
- [@Anthony-Gaudino](https://github.com/Anthony-Gaudino)
|