Skip to content

Commit

Permalink
Merge pull request getpelican#441 from jranke/i18n
Browse files Browse the repository at this point in the history
Make pelican-bootstrap3 multilingual
  • Loading branch information
justinmayer authored Dec 13, 2016
2 parents 30c8075 + db5388e commit b6ab2ad
Show file tree
Hide file tree
Showing 28 changed files with 1,210 additions and 49 deletions.
19 changes: 19 additions & 0 deletions pelican-bootstrap3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
help:
@echo 'Makefile for translation '
@echo ' '
@echo 'Usage: '
@echo ' make extract Extract message strings '
@echo ' make update Extract strings and update po files '
@echo ' make compile Compile po files to mo files '
@echo ' '

extract:
pybabel extract --mapping babel.cfg --output messages.pot ./

update: extract
pybabel update --input-file messages.pot --output-dir translations/ --domain messages

compile:
pybabel compile --directory translations/ --domain messages

.PHONY: help extract update compile
12 changes: 11 additions & 1 deletion pelican-bootstrap3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ First:

Then:

Point the `THEME` variable in your `pelicanconf.py` to `/path/to/pelican-bootstrap3`
Point the `THEME` variable in your `pelicanconf.py` to
`/path/to/pelican-bootstrap3` and add

`JINJA_EXTENSIONS = ['jinja2.ext.i18n']`

to your Pelican configuration, as this template can be translated (see below).

## Usage

Expand Down Expand Up @@ -347,6 +352,11 @@ Originally developed for including certification marks in your sidebar. E.g.,

http://dmark.github.io

### Translations

This template can be translated using pybabel and the enclosed Makefile. See
[Localizing themes with Jinja2](https://github.com/getpelican/pelican-plugins/blob/master/i18n_subsites/localizing_using_jinja2.rst) for more details and pointers.

## Live example

[This is the website of the original author](http://dandydev.net)
Expand Down
1 change: 1 addition & 0 deletions pelican-bootstrap3/babel.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[jinja2: templates/**.html]
Loading

0 comments on commit b6ab2ad

Please sign in to comment.