X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flisp%2Fparser.cpp;h=4f7697c42b2c47207fa31d52d43f626340b482d0;hb=b029182b66e1f36e8eb7a1d8d23d26d475dec45f;hp=52e87b2973c76a8a66ef4c2c00832647f39e4b8d;hpb=7b74666be6929322c6a603a6edd0131378f4c144;p=supertux.git diff --git a/src/lisp/parser.cpp b/src/lisp/parser.cpp index 52e87b297..4f7697c42 100644 --- a/src/lisp/parser.cpp +++ b/src/lisp/parser.cpp @@ -30,6 +30,8 @@ #include "lisp.hpp" #include "obstack/obstackpp.hpp" +#include "gameconfig.hpp" + namespace lisp { @@ -39,6 +41,7 @@ Parser::Parser(bool translate) if(translate) { dictionary_manager = new TinyGetText::DictionaryManager(); dictionary_manager->set_charset("UTF-8"); + if (config && (config->locale != "")) dictionary_manager->set_language(config->locale); } obstack_init(&obst); @@ -104,7 +107,7 @@ Parser::parse_error(const char* msg) const { std::stringstream emsg; emsg << "Parse Error at '" << filename << "' line " << lexer->getLineNumber() - << ": " << msg; + << ": " << msg; throw std::runtime_error(emsg.str()); } @@ -114,7 +117,7 @@ Parser::read() Lisp* result; switch(token) { case Lexer::TOKEN_EOF: { - parse_error("Unexpected EOF."); + parse_error("Unexpected EOF."); } case Lexer::TOKEN_CLOSE_PAREN: { parse_error("Unexpected ')'."); @@ -134,7 +137,7 @@ Parser::read() // evaluate translation function (_ str) in place here token = lexer->getNextToken(); if(token != Lexer::TOKEN_STRING) - parse_error("Expected string after '(_'"); + parse_error("Expected string after '(_'"); result = new(obst) Lisp(Lisp::TYPE_STRING); if(dictionary) { @@ -148,7 +151,7 @@ Parser::read() } token = lexer->getNextToken(); if(token != Lexer::TOKEN_CLOSE_PAREN) - parse_error("Expected ')' after '(_ string'"); + parse_error("Expected ')' after '(_ string'"); break; }