From c62549a2e77b14f73b13aa515b6884a478b8328a Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Wed, 21 Oct 2015 13:57:47 +0200 Subject: [PATCH] Don't crash on unknonwn babel languages --- patacrep/songs/latex/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/patacrep/songs/latex/__init__.py b/patacrep/songs/latex/__init__.py index 620475a2..980fece2 100644 --- a/patacrep/songs/latex/__init__.py +++ b/patacrep/songs/latex/__init__.py @@ -44,8 +44,11 @@ class LatexSong(Song): if language == babel_language: self.lang = lang 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 = { 'is': LatexSong,