From: Tobias Markus Date: Sun, 1 Mar 2015 22:52:30 +0000 (+0100) Subject: Fix level names when language is set to auto-detect X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f2d761ff31e00ea72783878b7e1586a357e15d5a;p=supertux.git Fix level names when language is set to auto-detect --- diff --git a/src/lisp/parser.cpp b/src/lisp/parser.cpp index 6eb17da80..2a09de80f 100644 --- a/src/lisp/parser.cpp +++ b/src/lisp/parser.cpp @@ -21,6 +21,7 @@ #include "lisp/lisp.hpp" #include "lisp/parser.hpp" +#include "util/gettext.hpp" #include "util/obstackpp.hpp" #include "physfs/ifile_stream.hpp" #include "physfs/ifile_streambuf.hpp" @@ -42,8 +43,15 @@ Parser::Parser(bool translate) : if(translate) { dictionary_manager = new tinygettext::DictionaryManager(); dictionary_manager->set_charset("UTF-8"); - if (g_config && (g_config->locale != "")) - dictionary_manager->set_language(tinygettext::Language::from_name(g_config->locale)); + if (g_config) { + if (g_config->locale != "") { + dictionary_manager->set_language(tinygettext::Language::from_name(g_config->locale)); + } + else if(g_dictionary_manager && g_dictionary_manager->get_language()) { + // Language set to auto-detect? + dictionary_manager->set_language(g_dictionary_manager->get_language()); + } + } } obstack_init(&obst);