Skip to content

Commit 427b940

Browse files
committed
use Czech as default
lang detection won't work for a static site - #34 (comment) let's assume most visitors understand Czech
1 parent 9a179a4 commit 427b940

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pyvecorg/views.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def favicon():
2020

2121
@app.route('/')
2222
def index_redirect():
23-
return redirect(url_for('index', lang=detect_lang(request)))
23+
return redirect(url_for('index', lang='cs'))
2424

2525

2626
@app.route('/<lang>/')
@@ -33,15 +33,9 @@ def index(lang):
3333

3434
@app.route('/api.json')
3535
def api_redirect():
36-
return redirect(url_for('api', lang=detect_lang(request)))
36+
return redirect(url_for('api', lang='cs'))
3737

3838

3939
@app.route('/<lang>/api.json')
4040
def api(lang):
4141
return jsonify(select_language(data, lang))
42-
43-
44-
def detect_lang(request):
45-
if request.accept_languages.best_match(['en', 'cs', 'sk']) == 'en':
46-
return 'en'
47-
return 'cs'

0 commit comments

Comments
 (0)