pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r3920 - trunk/pingus/src


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3920 - trunk/pingus/src
Date: Sun, 27 Jul 2008 19:02:39 +0200

Author: grumbel
Date: 2008-07-27 19:02:31 +0200 (Sun, 27 Jul 2008)
New Revision: 3920

Modified:
   trunk/pingus/src/system.cpp
   trunk/pingus/src/system.hpp
Log:
Unused functions removed

Modified: trunk/pingus/src/system.cpp
===================================================================
--- trunk/pingus/src/system.cpp 2008-07-27 16:59:05 UTC (rev 3919)
+++ trunk/pingus/src/system.cpp 2008-07-27 17:02:31 UTC (rev 3920)
@@ -366,55 +366,6 @@
 }
 
 std::string
-System::translate(const std::map<std::string, std::string>& strs)
-{
-  if (pingus_debug_flags & PINGUS_DEBUG_TRANSLATOR)
-    {
-      std::cout << ",-- [ Translator: lang=" << System::get_language ()
-               << " default=" << default_language << " ] --" << std::endl;
-      for (std::map<std::string, std::string>::const_iterator i = strs.begin 
();
-          i != strs.end (); ++i)
-       {
-         std::cout << "|  [" << i->first << "] ->" <<  i->second << std::endl;
-       }
-      std::cout << "`-- [ End Translator ] -----------------------" << 
std::endl;
-    }
-
-  std::map<std::string, std::string>::const_iterator p = 
strs.find(System::get_language());
-
-  if (p == strs.end ())
-    { // No native-language text found, fallback to default
-      return translate_default(strs);
-    }
-  else
-    { // Native language was empty, try default fallback
-      if (p->second.empty())
-       {
-          return translate_default(strs);
-       }
-      else
-        {
-          return p->second;
-        }
-    }
-}
-
-std::string
-System::translate_default(const std::map<std::string, std::string>& strs)
-{
-  std::map<std::string, std::string>::const_iterator default_text = 
strs.find(default_language);
-
-  if (default_text == strs.end())
-    { // no 'en' default text given probally a bug in the level data
-      return "<Translation Bug: no 'en' text given>";
-    }
-  else
-    {
-      return default_text->second;
-    }
-}
-
-std::string
 System::checksum(const Pathname& pathname)
 {
   return checksum(pathname.get_sys_path());

Modified: trunk/pingus/src/system.hpp
===================================================================
--- trunk/pingus/src/system.hpp 2008-07-27 16:59:05 UTC (rev 3919)
+++ trunk/pingus/src/system.hpp 2008-07-27 17:02:31 UTC (rev 3920)
@@ -102,15 +102,6 @@
   /** Return the modification time of a file */
   static uint64_t get_mtime(const std::string& filename);
 
-  /** Choose the correct translation out of the map, if there is none
-      present, fall back to the default language */
-  static std::string translate(const std::map<std::string, std::string>& strs);
-
-  static std::string translate(const std::string& str);
-
-  /** Translate to 'en' */
-  static std::string translate_default(const std::map<std::string, 
std::string>& strs);
-
   /** Removes all .., double slashes and such from a pathname */
   static std::string realpath(const std::string& pathname);
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]