Skip to content

Commit

Permalink
Use Babel to generate translation strings
Browse files Browse the repository at this point in the history
  • Loading branch information
torkve committed Dec 5, 2013
1 parent 7d47865 commit c712499
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 4 additions & 0 deletions babel.cfg
@@ -0,0 +1,4 @@
# Extraction from Python source files
[python: **.py]
# Extraction from Jinja2 template files
[jinja2: **.html]
17 changes: 5 additions & 12 deletions scripts/make-messages.sh
@@ -1,17 +1,10 @@
#!/bin/bash

xgettext -d mailpile -L Python \
$(find . -name "*.py") \
$(find . -name "*.html") \
--keyword=gettext_noop \
--keyword=gettext_lazy \
--keyword=ngettext_lazy:1,2 \
--keyword=pgettext:1c,2 \
--keyword=npgettext:1c,2,3 \
--from-code UTF-8 \
-o locale/mailpile.pot

# --omit-header
pybabel extract --project=mailpile \
-F babel.cfg \
-o locale/mailpile.pot \
.
# --omit-header

for L in $(find locale/* -type d \
| grep -v "LC_MESSAGES" \
Expand Down

0 comments on commit c712499

Please sign in to comment.