Bläddra i källkod

[fix] category name i18n - closes #221

Adam Tauber 10 år sedan
förälder
incheckning
e43f61069a
2 ändrade filer med 10 tillägg och 2 borttagningar
  1. 10
    0
      searx/webapp.py
  2. 0
    2
      utils/update-translations.sh

+ 10
- 0
searx/webapp.py Visa fil

97
 
97
 
98
 cookie_max_age = 60 * 60 * 24 * 365 * 5  # 5 years
98
 cookie_max_age = 60 * 60 * 24 * 365 * 5  # 5 years
99
 
99
 
100
+_category_names = (gettext('files'),
101
+                   gettext('general'),
102
+                   gettext('music'),
103
+                   gettext('social media'),
104
+                   gettext('images'),
105
+                   gettext('videos'),
106
+                   gettext('it'),
107
+                   gettext('news'),
108
+                   gettext('map'))
109
+
100
 
110
 
101
 @babel.localeselector
111
 @babel.localeselector
102
 def get_locale():
112
 def get_locale():

+ 0
- 2
utils/update-translations.sh Visa fil

10
 pybabel extract -F babel.cfg -o messages.pot $SEARX_DIR
10
 pybabel extract -F babel.cfg -o messages.pot $SEARX_DIR
11
 for f in `ls $SEARX_DIR'/translations/'`; do
11
 for f in `ls $SEARX_DIR'/translations/'`; do
12
     pybabel update -N -i messages.pot -d $SEARX_DIR'/translations/' -l $f
12
     pybabel update -N -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
13
 done
16
 
14
 
17
 echo '[!] update done, edit .po files if required and run pybabel compile -d searx/translations/'
15
 echo '[!] update done, edit .po files if required and run pybabel compile -d searx/translations/'