summaryrefslogtreecommitdiff
path: root/ausbutler/tour_config.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-01-06 03:36:49 +0100
committeremkael <emkael@tlen.pl>2017-01-06 03:36:49 +0100
commitabd09ddce26dfc8dee8b352e86c50185d548e61a (patch)
tree7e6beab92b6083278876c823940407f8e56ee55f /ausbutler/tour_config.py
parentcbb74e0b5971fe4453477094558cdb125bee4524 (diff)
Code formatting
Diffstat (limited to 'ausbutler/tour_config.py')
-rw-r--r--ausbutler/tour_config.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/ausbutler/tour_config.py b/ausbutler/tour_config.py
index a651be4..1edb259 100644
--- a/ausbutler/tour_config.py
+++ b/ausbutler/tour_config.py
@@ -4,23 +4,31 @@ from .model import Parameters, Translation
session = get_session()
+
class Translations(object):
- translation_cache = { t.id: t.dane for t
- in session.query(Translation).all() }
+ translation_cache = {
+ t.id: t.dane for t
+ in session.query(Translation).all()
+ }
translation_mapping = load_config('logoh')
custom_translations = load_config('translations')
@staticmethod
def get_translation(key):
if key in Translations.translation_mapping:
- return Translations.translation_cache[Translations.translation_mapping[key]]
+ return Translations.translation_cache[
+ Translations.translation_mapping[key]]
if key in Translations.custom_translations:
- return Translations.custom_translations[key][Translations.detect_language()]
+ return Translations.custom_translations[key][
+ Translations.detect_language()]
return '{{%s}}' % (key)
@staticmethod
def detect_language():
- return 'en' if Translations.get_translation('ROUND').lower().strip() == 'round' else 'pl'
+ if Translations.get_translation('ROUND').lower().strip() == 'round':
+ return 'en'
+ else:
+ return 'pl'
Constants = session.query(Parameters).one()