Browse Source

Properly log the error when the language code is unknown

pull/124/head
Oliverpool 9 years ago
parent
commit
f7c8b52e40
  1. 4
      patacrep/songs/__init__.py

4
patacrep/songs/__init__.py

@ -27,8 +27,8 @@ def lang2language(lang):
try: try:
return BABEL_LANGUAGES[lang] return BABEL_LANGUAGES[lang]
except KeyError: except KeyError:
# TODO: raise a nice error available = ", ".join(BABEL_LANGUAGES.keys())
print('Unknown lang:' + lang) LOGGER.error('Unknown lang code: ' + lang + '. Supported: ' + available)
return 'english' return 'english'
def cached_name(datadir, filename): def cached_name(datadir, filename):

Loading…
Cancel
Save