1.1 --- a/pymove3d.py Sun Jan 19 07:53:05 2014 +0100
1.2 +++ b/pymove3d.py Sun Jan 19 08:18:43 2014 +0100
1.3 @@ -51,13 +51,19 @@
1.4 def de():
1.5 global LANGUAGE_SELECTED
1.6 LANGUAGE_SELECTED = "de"
1.7 - return render_template("/de/index.html")
1.8 + saying, author = get_saying()
1.9 + return render_template("/de/index.html",
1.10 + saying = saying,
1.11 + author = author)
1.12
1.13 @app.route('/en')
1.14 def en():
1.15 + saying, author = get_saying()
1.16 global LANGUAGE_SELECTED
1.17 LANGUAGE_SELECTED = "en"
1.18 - return render_template("/en/index.html")
1.19 + return render_template("/en/index.html",
1.20 + saying = saying,
1.21 + author = author)
1.22
1.23 @app.route("/competition")
1.24 def competition():
2.1 --- a/sayings.py Sun Jan 19 07:53:05 2014 +0100
2.2 +++ b/sayings.py Sun Jan 19 08:18:43 2014 +0100
2.3 @@ -1,25 +1,26 @@
2.4 +from flask.ext.babel import gettext as _
2.5 from random import shuffle
2.6
2.7 def get_saying():
2.8 - sayings = [('The Zen of Python, by Tim Peters', '__Tim Peters, The Zen of Python'),
2.9 - ("Beautiful is better than ugly.", '__Tim Peters, The Zen of Python'),
2.10 - ("Explicit is better than implicit.", '__Tim Peters, The Zen of Python'),
2.11 - ("Simple is better than complex.", '__Tim Peters, The Zen of Python'),
2.12 - ("Complex is better than complicated.", '__Tim Peters, The Zen of Python'),
2.13 - ("Flat is better than nested.", '__Tim Peters, The Zen of Python'),
2.14 - ("Sparse is better than dense.", '__Tim Peters, The Zen of Python'),
2.15 - ("Readability counts.", '__Tim Peters, The Zen of Python'),
2.16 - ("Special cases aren't special enough to break the rules.", '__Tim Peters, The Zen of Python'),
2.17 - ("Although practicality beats purity.", '__Tim Peters, The Zen of Python'),
2.18 - ("Errors should never pass silently.", '__Tim Peters, The Zen of Python'),
2.19 - ("Unless explicitly silenced.", '__Tim Peters, The Zen of Python'),
2.20 - ("In the face of ambiguity, refuse the temptation to guess.", '__Tim Peters, The Zen of Python'),
2.21 - ("Although that way may not be obvious at first unless you're Dutch.", '__Tim Peters, The Zen of Python'),
2.22 - ("Now is better than never.", '__Tim Peters, The Zen of Python'),
2.23 - ("Although never is often better than *right* now.", '__Tim Peters, The Zen of Python'),
2.24 - ("If the implementation is hard to explain, it's a bad idea.", '__Tim Peters, The Zen of Python'),
2.25 - ("If the implementation is easy to explain, it may be a good idea.", '__Tim Peters, The Zen of Python'),
2.26 - ("Namespaces are one honking great idea -- let's do more of those!", '__Tim Peters, The Zen of Python'),
2.27 + sayings = [(_('The Zen of Python, by Tim Peters'), _('__Tim Peters, The Zen of Python')),
2.28 + (_("Beautiful is better than ugly."), _('__Tim Peters, The Zen of Python')),
2.29 + (_("Explicit is better than implicit."), _('__Tim Peters, The Zen of Python')),
2.30 + (_("Simple is better than complex."), _('__Tim Peters, The Zen of Python')),
2.31 + (_("Complex is better than complicated."), _('__Tim Peters, The Zen of Python')),
2.32 + (_("Flat is better than nested."), _('__Tim Peters, The Zen of Python')),
2.33 + (_("Sparse is better than dense."), _('__Tim Peters, The Zen of Python')),
2.34 + (_("Readability counts."), _('__Tim Peters, The Zen of Python')),
2.35 + (_("Special cases aren't special enough to break the rules."), _('__Tim Peters, The Zen of Python')),
2.36 + (_("Although practicality beats purity."), _('__Tim Peters, The Zen of Python')),
2.37 + (_("Errors should never pass silently."), _('__Tim Peters, The Zen of Python')),
2.38 + (_("Unless explicitly silenced."), _('__Tim Peters, The Zen of Python')),
2.39 + (_("In the face of ambiguity, refuse the temptation to guess."), _('__Tim Peters, The Zen of Python')),
2.40 + (_("Although that way may not be obvious at first unless you're Dutch."), _('__Tim Peters, The Zen of Python')),
2.41 + (_("Now is better than never."), _('__Tim Peters, The Zen of Python')),
2.42 + (_("Although never is often better than *right* now."), _('__Tim Peters, The Zen of Python')),
2.43 + (_("If the implementation is hard to explain, it's a bad idea."), _('__Tim Peters, The Zen of Python')),
2.44 + (_("If the implementation is easy to explain, it may be a good idea."), _('__Tim Peters, The Zen of Python')),
2.45 + (_("Namespaces are one honking great idea -- let's do more of those!"), _('__Tim Peters, The Zen of Python')),
2.46 ]
2.47
2.48 shuffle(sayings)