Fixed wrong "top-edge" tiles in data/levels/bonus2/level11.stl ("The long cave")
[supertux.git] / src / tinygettext / tinygettext.cpp
index 424e97c..e248801 100644 (file)
@@ -1,7 +1,7 @@
 //  $Id$
-// 
-//  TinyGetText - A small flexible gettext() replacement
-//  Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
+//
+//  TinyGetText
+//  Copyright (C) 2006 Ingo Ruhnke <grumbel@gmx.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
 #include <config.h>
 
 #include <sys/types.h>
@@ -26,9 +27,9 @@
 #include <errno.h>
 
 #include "tinygettext.hpp"
-#include "msg.hpp"
+#include "log.hpp"
 #include "physfs/physfs_stream.hpp"
-#include "msg.hpp"
+#include "log.hpp"
 
 //#define TRANSLATION_DEBUG
 
@@ -60,8 +61,8 @@ std::string convert(const std::string& text,
   out_len -= out_len_temp; // see above
   if (retval == (size_t) -1)
     {
-      msg_warning << strerror(errno) << std::endl;
-      msg_warning << "Error: conversion from " << from_charset << " to " << to_charset << " went wrong: " << retval << std::endl;
+      log_warning << strerror(errno) << std::endl;
+      log_warning << "Error: conversion from " << from_charset << " to " << to_charset << " went wrong: " << retval << std::endl;
       return "";
     }
   iconv_close(cd);
@@ -237,7 +238,7 @@ DictionaryManager::get_dictionary(const std::string& spec)
     }
   else // Dictionary for languages lang isn't loaded, so we load it
     {
-      //msg_debug << "get_dictionary: " << lang << std::endl;
+      //log_debug << "get_dictionary: " << lang << std::endl;
       Dictionary& dict = dictionaries[lang];
 
       dict.set_language(get_language_def(lang));
@@ -249,7 +250,7 @@ DictionaryManager::get_dictionary(const std::string& spec)
           char** files = PHYSFS_enumerateFiles(p->c_str());
           if(!files) 
             {
-              msg_warning << "Error: enumerateFiles() failed on " << *p << std::endl;
+              log_warning << "Error: enumerateFiles() failed on " << *p << std::endl;
             }
           else
             {
@@ -261,8 +262,8 @@ DictionaryManager::get_dictionary(const std::string& spec)
                       IFileStream in(pofile);
                       read_po_file(dict, in);
                   } catch(std::exception& e) {
-                      msg_warning << "Error: Failure file opening: " << pofile << std::endl;
-                      msg_warning << e.what() << "" << std::endl;
+                      log_warning << "Error: Failure file opening: " << pofile << std::endl;
+                      log_warning << e.what() << "" << std::endl;
                   }
                 }
               }
@@ -284,7 +285,7 @@ DictionaryManager::get_languages()
       char** files = PHYSFS_enumerateFiles(p->c_str());
       if (!files)
         {
-          msg_warning << "Error: opendir() failed on " << *p << std::endl;
+          log_warning << "Error: opendir() failed on " << *p << std::endl;
         }
       else
         {
@@ -405,10 +406,10 @@ Dictionary::translate(const std::string& msgid, const std::string& msgid2, int n
   else
     {
 #ifdef TRANSLATION_DEBUG
-      msg_warning << "Couldn't translate: " << msgid << std::endl;
-      msg_warning << "Candidates: " << std::endl;
+      log_warning << "Couldn't translate: " << msgid << std::endl;
+      log_warning << "Candidates: " << std::endl;
       for (PluralEntries::iterator i = plural_entries.begin(); i != plural_entries.end(); ++i)
-        msg_debug << "'" << i->first << "'" << std::endl;
+        log_debug << "'" << i->first << "'" << std::endl;
 #endif
 
       if (plural2_1(num)) // default to english rules
@@ -429,7 +430,7 @@ Dictionary::translate(const char* msgid)
   else
     {
 #ifdef TRANSLATION_DBEUG
-      msg_warning << "Couldn't translate: " << msgid << std::endl;
+      log_warning << "Couldn't translate: " << msgid << std::endl;
 #endif
       return msgid;
     }
@@ -446,7 +447,7 @@ Dictionary::translate(const std::string& msgid)
   else
     {
 #ifdef TRANSLATION_DBEUG
-      msg_warning << "Couldn't translate: " << msgid << std::endl;
+      log_warning << "Couldn't translate: " << msgid << std::endl;
 #endif
       return msgid;
     }
@@ -530,7 +531,7 @@ public:
 
     if (from_charset.empty() || from_charset == "CHARSET")
       {
-        msg_warning << "Error: Charset not specified for .po, fallback to ISO-8859-1" << std::endl;
+        log_warning << "Error: Charset not specified for .po, fallback to ISO-8859-1" << std::endl;
         from_charset = "ISO-8859-1";
       }
 
@@ -554,11 +555,11 @@ public:
           }
         else if (token.keyword.empty())
           {
-            //msg_warning << "Got EOF, everything looks ok." << std::endl;
+            //log_warning << "Got EOF, everything looks ok." << std::endl;
           }
         else
           {
-            msg_warning << "tinygettext: expected 'msgid' keyword, got " << token.keyword << " at line " << line_num << std::endl;
+            log_warning << "tinygettext: expected 'msgid' keyword, got " << token.keyword << " at line " << line_num << std::endl;
           }
         break;
     
@@ -590,7 +591,7 @@ public:
           } 
         else
           {
-            msg_warning << "tinygettext: expected 'msgstr' keyword, got " << token.keyword << " at line " << line_num << std::endl;
+            log_warning << "tinygettext: expected 'msgstr' keyword, got " << token.keyword << " at line " << line_num << std::endl;
           }
         break;
 
@@ -600,7 +601,7 @@ public:
             int num;
             if (sscanf(token.keyword.c_str(), "msgstr[%d]", &num) != 1) 
               {
-                msg_warning << "Error: Couldn't parse: " << token.keyword << std::endl;
+                log_warning << "Error: Couldn't parse: " << token.keyword << std::endl;
               } 
             else 
               {
@@ -639,7 +640,7 @@ public:
 
     while((c = getchar(in)) != EOF)
       {
-        //msg_debug << "Lexing char: " << char(c) << " " << state << std::endl;
+        //log_debug << "Lexing char: " << char(c) << " " << state << std::endl;
         switch(state)
           {
           case READ_KEYWORD:
@@ -690,12 +691,12 @@ public:
                   else if (c == '"') token.content += '"';
                   else
                     {
-                      msg_warning << "Unhandled escape character: " << char(c) << std::endl;
+                      log_warning << "Unhandled escape character: " << char(c) << std::endl;
                     }
                 }
               else
                 {
-                  msg_warning << "Unterminated string" << std::endl;
+                  log_warning << "Unterminated string" << std::endl;
                 }
             } else if (c == '"') { // Content string is terminated
               state = READ_CONTENT;