File tree 7 files changed +52
-0
lines changed
7 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 3
3
* .pyc
4
4
pelican.pid
5
5
srv.pid
6
+ themes /i18n /translations /* /LC_MESSAGES /* .mo
6
7
7
8
# This is a generic Python gitignore
8
9
# https://github.com/github/gitignore/blob/2eba0d635f6f5f1b22a4ad99dcc9da0c11da2208/Python.gitignore
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ export TZ=UTC
4
+
5
+ pybabel init -i themes/i18n/messages.pot -d themes/i18n/translations -l $1
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ export TZ=UTC
4
+
5
+ pybabel compile -d themes/i18n/translations
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ export TZ=UTC
4
+
5
+ if [ -e themes/i18n/messages.pot ]; then
6
+ mv themes/i18n/messages.pot themes/i18n/messages.pot.old
7
+ fi
8
+
9
+ pybabel extract --msgid-bugs-address=" https://github.com/Tox/tox.chat/issues" \
10
+ --copyright-holder=" Project Tox Website Contributors" \
11
+ --project=" Tox Website" \
12
+ --version=" (https://tox.chat)" \
13
+ --sort-by-file \
14
+ -F themes/i18n/babel.cfg \
15
+ -o themes/i18n/messages.pot \
16
+ .
17
+
18
+ if [ -e themes/i18n/messages.pot.old ]; then
19
+ if diff -u <( sed ' /POT-Creation-Date/d' themes/i18n/messages.pot) <( sed ' /POT-Creation-Date/d' themes/i18n/messages.pot.old) ; then
20
+ echo " No translation strings changed, keeping the old POT"
21
+ mv themes/i18n/messages.pot.old themes/i18n/messages.pot
22
+ else
23
+ echo " Translation strings changed, using the new POT"
24
+ rm themes/i18n/messages.pot.old
25
+ fi
26
+ fi
27
+
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ export TZ=UTC
4
+
5
+ pybabel update -i themes/i18n/messages.pot -d themes/i18n/translations
6
+
7
+ for file in themes/i18n/translations/* /LC_MESSAGES/* .po; do
8
+ sed -i ' /^#~/,+2d' $file
9
+ done
10
+
Original file line number Diff line number Diff line change @@ -211,6 +211,7 @@ def copy_list(l):
211
211
# https://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites
212
212
# http://jinja.pocoo.org/docs/2.10/templates/#i18n
213
213
# http://mozweb.readthedocs.io/en/latest/reference/l10n.html
214
+ I18N_GETTEXT_LOCALEDIR = 'themes/i18n/translations'
214
215
I18N_UNTRANSLATED_ARTICLES = 'keep'
215
216
I18N_UNTRANSLATED_PAGES = 'keep'
216
217
I18N_SUBSITES = {
Original file line number Diff line number Diff line change
1
+ [jinja2: themes/global/templates/**.html]
2
+ [jinja2: themes/website/templates/**.html]
3
+ [jinja2: themes/blog/templates/**.html]
You can’t perform that action at this time.
0 commit comments