pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r2954 - in branches/pingus_sdl: . src src/tinygettext


From: grumbel at BerliOS
Subject: [Pingus-CVS] r2954 - in branches/pingus_sdl: . src src/tinygettext
Date: Thu, 16 Aug 2007 06:43:37 +0200

Author: grumbel
Date: 2007-08-16 06:43:35 +0200 (Thu, 16 Aug 2007)
New Revision: 2954

Modified:
   branches/pingus_sdl/TODO
   branches/pingus_sdl/src/pingus_main.cpp
   branches/pingus_sdl/src/tinygettext/tinygettext.hpp
Log:
- some work on translations

Modified: branches/pingus_sdl/TODO
===================================================================
--- branches/pingus_sdl/TODO    2007-08-16 04:39:58 UTC (rev 2953)
+++ branches/pingus_sdl/TODO    2007-08-16 04:43:35 UTC (rev 2954)
@@ -63,13 +63,9 @@
 
 - src/components/pingus_counter.hpp font should be fixed-width/monospace
 
-- lacks background: data/levels/tutorial/snow10-grumbel.pingus
-
 Nice to Have:
 =============
 
-- Sprite class is bonkers, fill() and scale() depend on order
-
 - story graphics have a missing vertical line (due to age old gimp scaling bug)
 
 - separate gfx/colmap surfaces aren't used

Modified: branches/pingus_sdl/src/pingus_main.cpp
===================================================================
--- branches/pingus_sdl/src/pingus_main.cpp     2007-08-16 04:39:58 UTC (rev 
2953)
+++ branches/pingus_sdl/src/pingus_main.cpp     2007-08-16 04:43:35 UTC (rev 
2954)
@@ -229,6 +229,8 @@
                   _("Loads the level editor"));
   argp.add_option(363, "font", "FILE",
                   _("Test a font"));
+  argp.add_option(364, "language", "LANG",
+                  _("Select language for use with Pingus"));
   argp.add_option('v', "verbose", "", 
                   _("Print some more messages to stdout, can be set multiple 
times to increase verbosity"));
   argp.add_option('V', "version", "", 
@@ -392,10 +394,12 @@
           fullscreen_enabled = true;
           break;
 
+#if 0
         case 'R': // --refresh-rate
           sscanf(argp.get_argument().c_str(), "%d", &refresh_rate);
           std::cout << "Pingus: Refresh rate is " << refresh_rate << std::endl;
           break;
+#endif
           
         case 'w': // --window
           fullscreen_enabled = false;
@@ -531,6 +535,10 @@
           fontfile = argp.get_argument();
           break;
 
+        case 364: // language
+          dictionary_manager.set_language(argp.get_argument()); 
+          break;
+
         case 'h':
           argp.print_help();
           exit(EXIT_SUCCESS);
@@ -605,33 +613,28 @@
       exit(EXIT_FAILURE);
     }
 
-  dictionary_manager.add_directory(path_manager.complete("po/"));
   // Language is automatically picked from env variable
   // dictionary_manager.set_language("de"); 
+  dictionary_manager.add_directory(path_manager.complete("po/"));
 
-  const char* lang = getenv("LC_ALL");
-  if(!lang) lang = getenv("LC_MESSAGES");
-  if(!lang) lang = getenv("LANG");
-  if(lang)
+  std::string language = 
dictionary_manager.get_dictionary().get_language().name;
+
+  language.resize(2);
+  if(language == "cs" || language == "sr")
     {
-      std::string language(lang);
-      language.resize(2);
-      if(language == "cs" || language == "sr")
-        {
-          dictionary_manager.set_charset("ISO-8859-2");
-          //Pingus::Fonts::encoding = "ISO-8859-2";
-        }
-      else if(language == "tr")
-        {
-          dictionary_manager.set_charset("ISO-8859-9");
-          //Pingus::Fonts::encoding = "ISO-8859-9";
-        }
-      else
-        {
-          dictionary_manager.set_charset("ISO-8859-1");
-          //Pingus::Fonts::encoding = "ISO-8859-1";
-        }
+      dictionary_manager.set_charset("ISO-8859-2");
+      //Pingus::Fonts::encoding = "ISO-8859-2";
     }
+  else if(language == "tr")
+    {
+      dictionary_manager.set_charset("ISO-8859-9");
+      //Pingus::Fonts::encoding = "ISO-8859-9";
+    }
+  else
+    {
+      dictionary_manager.set_charset("ISO-8859-1");
+      //Pingus::Fonts::encoding = "ISO-8859-1";
+    }
 
   if (maintainer_mode)
     std::cout << "BasePath: " << path_manager.get_base_path () << std::endl;
@@ -650,12 +653,7 @@
     std::cout.put('=');
   std::cout << std::endl;
 
-#ifdef HAVE_GETTEXT
-  std::cout << _("getext support:               ok") << std::endl;
-  std::cout << _("gettext language:        english") << std::endl;
-#else
-  std::cout << "getext support: missing (only support for english will be 
available)" << std::endl;
-#endif
+  std::cout << _("language:                ") << 
dictionary_manager.get_dictionary().get_language().name << std::endl;
 
   if (sound_enabled)
     std::cout << _("sound support:           enabled") << std::endl;
@@ -667,11 +665,11 @@
   else
     std::cout << _("music support:          disabled") << std::endl;
 
-  std::cout << _("resolution set to:       ") << screen_width << "x" << 
screen_height << std::endl;
+  std::cout <<   _("resolution:              ") << screen_width << "x" << 
screen_height << std::endl;
   std::cout << _("fullscreen:              ")
             << (fullscreen_enabled ? _(" enabled") : _("disabled"))
             << std::endl;
-  std::cout << _("refresh rate:            ") << refresh_rate << std::endl;
+  //std::cout << _("refresh rate:            ") << refresh_rate << std::endl;
   std::cout << _("using OpenGL:            ") << use_opengl << std::endl;
 
   std::cout << std::endl;

Modified: branches/pingus_sdl/src/tinygettext/tinygettext.hpp
===================================================================
--- branches/pingus_sdl/src/tinygettext/tinygettext.hpp 2007-08-16 04:39:58 UTC 
(rev 2953)
+++ branches/pingus_sdl/src/tinygettext/tinygettext.hpp 2007-08-16 04:43:35 UTC 
(rev 2954)
@@ -72,6 +72,8 @@
       mainly needed to evaluate plural forms */
   void set_language(const LanguageDef& lang);
 
+  LanguageDef get_language() const { return language; }
+
   /** Translate the string \a msgid to its correct plural form, based
       on the number of items given by \a num. \a msgid2 is \a msgid in
       plural form. */





reply via email to

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