diff options
-rwxr-xr-x | update-messages | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/update-messages b/update-messages index 582481c..7565b9a 100755 --- a/update-messages +++ b/update-messages | |||
@@ -19,7 +19,15 @@ languages=$($sitegen/list-languages) | |||
19 | echo Using languages $languages | 19 | echo Using languages $languages |
20 | 20 | ||
21 | echo "Updating message catalog" | 21 | echo "Updating message catalog" |
22 | env "PYTHONPATH=$sitegen:${PYTHONPATH-:}" pybabel extract -F locale/babel.map -o locale/messages.pot . | 22 | env "PYTHONPATH=$sitegen:${PYTHONPATH-:}" pybabel extract -F locale/babel.map -o locale/messages.pot~ . |
23 | |||
24 | diffcount=$(diff locale/messages.pot locale/messages.pot~ | grep "^>" | wc -l) | ||
25 | |||
26 | # Only copy pot file if more than the timestamp changed | ||
27 | if [[ $diffcount -gt 1 ]]; then | ||
28 | cp locale/messages.pot~ locale/messages.pot | ||
29 | fi | ||
30 | |||
23 | 31 | ||
24 | echo "Updating existing translations" | 32 | echo "Updating existing translations" |
25 | for lang in $languages; do | 33 | for lang in $languages; do |