summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-01-05 13:35:02 +0100
committeremkael <emkael@tlen.pl>2019-01-05 13:35:02 +0100
commitfb59760d5169818774d51dc0a6a8e66e5cd2331f (patch)
tree6f3c8ae580234ad1f00012cfb6c72bb09d5db8be
parentb3f453150221b782b3a77dec331d144eb5ebc739 (diff)
Fixes #4
-rw-r--r--ausbutler/tour_config.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/ausbutler/tour_config.py b/ausbutler/tour_config.py
index 755bac9..8969d00 100644
--- a/ausbutler/tour_config.py
+++ b/ausbutler/tour_config.py
@@ -13,15 +13,24 @@ class Translations(object):
}
translation_mapping = load_config('logoh')
custom_translations = load_config('translations')
+ warned_missing_keys = []
@staticmethod
def get_translation(key):
+ missing_logoh_key = False
if key in Translations.translation_mapping:
- return Translations.translation_cache[
- Translations.translation_mapping[key]]
+ if Translations.translation_mapping[key] not in Translations.translation_cache:
+ missing_logoh_key = True
+ else:
+ return Translations.translation_cache[
+ Translations.translation_mapping[key]]
if key in Translations.custom_translations:
return Translations.custom_translations[key][
Translations.detect_language()]
+ elif missing_logoh_key:
+ if key not in Translations.warned_missing_keys:
+ print 'WARNING: translation key "%s" not found in logoh table!' % (key)
+ Translations.warned_missing_keys.append(key)
return '{{%s}}' % (key)
@staticmethod