Przeglądaj źródła

[enh] utils - translation updater script added

asciimoo 11 lat temu
rodzic
commit
474f6a861d
1 zmienionych plików z 17 dodań i 0 usunięć
  1. 17
    0
      utils/update-translations.sh

+ 17
- 0
utils/update-translations.sh Wyświetl plik

1
+#!/bin/sh
2
+
3
+# script to easily update translation language files
4
+
5
+# add new language:
6
+# pybabel init -i messages.pot -d searx/translations -l en
7
+
8
+SEARX_DIR='searx'
9
+
10
+pybabel extract -F babel.cfg -o messages.pot $SEARX_DIR
11
+for f in `ls $SEARX_DIR'/translations/'`; do
12
+    pybabel update -i messages.pot -d $SEARX_DIR'/translations/' -l $f
13
+    # TODO - need to fix category translations
14
+    sed -i 's/#~ //' $SEARX_DIR'/translations/'$f'/LC_MESSAGES/messages.po'
15
+done
16
+
17
+echo '[!] update done, edit .po files if required and run pybabel compile -d searx/translations/'