Browse Source

[enh] utils - translation updater script added

asciimoo 11 years ago
parent
commit
474f6a861d
1 changed files with 17 additions and 0 deletions
  1. 17 0
      utils/update-translations.sh

+ 17 - 0
utils/update-translations.sh

@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# script to easily update translation language files
+
+# add new language:
+# pybabel init -i messages.pot -d searx/translations -l en
+
+SEARX_DIR='searx'
+
+pybabel extract -F babel.cfg -o messages.pot $SEARX_DIR
+for f in `ls $SEARX_DIR'/translations/'`; do
+    pybabel update -i messages.pot -d $SEARX_DIR'/translations/' -l $f
+    # TODO - need to fix category translations
+    sed -i 's/#~ //' $SEARX_DIR'/translations/'$f'/LC_MESSAGES/messages.po'
+done
+
+echo '[!] update done, edit .po files if required and run pybabel compile -d searx/translations/'