equal
deleted
inserted
replaced
16 app = Flask(__name__) |
16 app = Flask(__name__) |
17 babel = Babel(app) |
17 babel = Babel(app) |
18 |
18 |
19 @babel.localeselector |
19 @babel.localeselector |
20 def get_locale(): |
20 def get_locale(): |
21 return request.accept_languages.best_match(LANGUAGES.keys()) |
21 """ToDo: if translation is completed, switch to en """ |
|
22 return request.accept_languages.best_match(LANGUAGES.keys()) or 'de' |
22 |
23 |
23 |
24 |
24 @app.route("/") |
25 @app.route("/") |
25 |
26 |
26 @app.route("/index") |
27 @app.route("/index") |
43 def coursematerial(): |
44 def coursematerial(): |
44 return render_template(get_locale() + "/coursematerial.html", act="coursematerial") |
45 return render_template(get_locale() + "/coursematerial.html", act="coursematerial") |
45 |
46 |
46 @app.route("/imprint") |
47 @app.route("/imprint") |
47 def imprint(): |
48 def imprint(): |
48 return render_template(get_locale () + "/imprint.html", act="imprint") |
49 return render_template(get_locale() + "/imprint.html", act="imprint") |
49 |
50 |
50 @app.route("/privacy") |
51 @app.route("/privacy") |
51 def privacy(): |
52 def privacy(): |
52 return render_template(get_locale() + "/privacy.html", act="privacy") |
53 return render_template(get_locale() + "/privacy.html", act="privacy") |
53 |
54 |
|
55 @app.route(_("/competition-2013")) |
|
56 def competition_2013(): |
|
57 return render_template(get_locale() + "/archive/competitions/2013/comptetition_2013.html", |
|
58 act="coursematerial") |
|
59 |
|
60 @app.route(_("/competition-2014")) |
|
61 def competition_2014(): |
|
62 return render_template(get_locale() + "archive/competitions/2014/competition_2014.html", |
|
63 act="coursematerial") |
54 |
64 |
55 @app.errorhandler(404) |
65 @app.errorhandler(404) |
56 def page_not_found(e): |
66 def page_not_found(e): |
57 return render_template(get_locale() + "/404.html") |
67 return render_template(get_locale() + "/404.html") |
58 |
68 |