From f2d761ff31e00ea72783878b7e1586a357e15d5a Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Sun, 1 Mar 2015 23:52:30 +0100 Subject: [PATCH] Fix level names when language is set to auto-detect --- src/lisp/parser.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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); -- 2.11.0