Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
598535b2
Commit
598535b2
authored
Jan 21, 2014
by
asciimoo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[mod] ui localization init - new dependency: flask-babel
parent
7295df30
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
+15
-2
requirements.txt
requirements.txt
+1
-0
webapp.py
searx/webapp.py
+12
-2
setup.py
setup.py
+1
-0
versions.cfg
versions.cfg
+1
-0
No files found.
requirements.txt
View file @
598535b2
flask
flask-babel
grequests
lxml
pyyaml
searx/webapp.py
View file @
598535b2
...
...
@@ -21,14 +21,17 @@ import json
import
cStringIO
import
os
from
searx
import
settings
from
flask
import
Flask
,
request
,
render_template
from
flask
import
url_for
,
Response
,
make_response
,
redirect
from
flask
import
send_from_directory
from
searx
import
settings
from
searx.engines
import
search
,
categories
,
engines
,
get_engines_stats
from
searx.utils
import
UnicodeWriter
from
flask
import
send_from_directory
from
searx.utils
import
highlight_content
,
html_to_text
from
flask.ext.babel
import
Babel
app
=
Flask
(
__name__
,
...
...
@@ -38,6 +41,8 @@ app = Flask(
app
.
secret_key
=
settings
[
'server'
][
'secret_key'
]
babel
=
Babel
(
app
)
#TODO configurable via settings.yml
favicons
=
[
'wikipedia'
,
'youtube'
,
'vimeo'
,
'soundcloud'
,
'twitter'
,
'stackoverflow'
,
'github'
]
...
...
@@ -56,6 +61,11 @@ opensearch_xml = '''<?xml version="1.0" encoding="utf-8"?>
'''
@
babel
.
localeselector
def
get_locale
():
return
request
.
accept_languages
.
best_match
(
settings
[
'languages'
]
.
keys
())
def
get_base_url
():
if
settings
[
'server'
][
'base_url'
]:
hostname
=
settings
[
'server'
][
'base_url'
]
...
...
setup.py
View file @
598535b2
...
...
@@ -30,6 +30,7 @@ setup(
zip_safe
=
False
,
install_requires
=
[
'flask'
,
'flask-babel'
,
'grequests'
,
'lxml'
,
'pyyaml'
,
...
...
versions.cfg
View file @
598535b2
[versions]
Flask = 0.10.1
Flask-Babel = 0.9
Jinja2 = 2.7.2
MarkupSafe = 0.18
WebOb = 1.3.1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment