Browse Source

Don't crash on unknonwn babel languages

pull/124/head
Oliverpool 9 years ago
parent
commit
c62549a2e7
  1. 7
      patacrep/songs/latex/__init__.py

7
patacrep/songs/latex/__init__.py

@ -44,8 +44,11 @@ class LatexSong(Song):
if language == babel_language: if language == babel_language:
self.lang = lang self.lang = lang
return return
# TODO: add as custom language
LOGGER.error('Unsupported language:' + language) # Add a custom language to the babel dictionary (language is not officially supported)
custom_lang = '_' + language
BABEL_LANGUAGES[custom_lang] = language
self.lang = custom_lang
SONG_PARSERS = { SONG_PARSERS = {
'is': LatexSong, 'is': LatexSong,

Loading…
Cancel
Save