Browse Source

pylint

pull/136/head
Louis 9 years ago
parent
commit
0731ab973d
  1. 14
      patacrep/latex/__init__.py

14
patacrep/latex/__init__.py

@ -91,9 +91,19 @@ def lang2babel(lang):
language = lang.lower().split("_")[0] language = lang.lower().split("_")[0]
for babel in BABEL_LANGUAGES: for babel in BABEL_LANGUAGES:
if babel.startswith(language): if babel.startswith(language):
LOGGER.error("Unknown country code '{}'. Using default '{}' instead.".format(lang, babel)) LOGGER.error(
"Unknown country code '{}'. Using default '{}' instead.".format(
lang,
babel
)
)
return BABEL_LANGUAGES[babel] return BABEL_LANGUAGES[babel]
except KeyError: except KeyError:
available = ", ".join(BABEL_LANGUAGES.keys()) available = ", ".join(BABEL_LANGUAGES.keys())
LOGGER.error("Unknown language code '{}' (supported: {}). Using default 'english' instead.".format(lang, available)) LOGGER.error(
"Unknown language code '{}' (supported: {}). Using default 'english' instead.".format(
lang,
available
)
)
return 'english' return 'english'

Loading…
Cancel
Save