Bug 160811
authorStefan Schubert <schubi@suse.de>
Thu, 6 Apr 2006 14:22:11 +0000 (14:22 +0000)
committerStefan Schubert <schubi@suse.de>
Thu, 6 Apr 2006 14:22:11 +0000 (14:22 +0000)
zypp/Locale.cc

index 6c4b5f3..10429af 100644 (file)
@@ -10,7 +10,7 @@
  *
 */
 #include <iostream>
-//#include "zypp/base/Logger.h"
+#include <map>
 
 #include "zypp/Locale.h"
 
@@ -20,6 +20,9 @@ using std::endl;
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
+  typedef std::map<std::string, std::string> OtherDefaultLanguage;
+  static OtherDefaultLanguage otherDefaultLanguage;
+    
   ///////////////////////////////////////////////////////////////////
   //
   //   CLASS NAME : Locale::Impl
@@ -79,6 +82,14 @@ namespace zypp
 
     Locale fallback() const
     {
+      if (otherDefaultLanguage.size() == 0) {
+         // initial inserting map
+         otherDefaultLanguage["pt_BR"] = "en";
+      }
+
+      if (otherDefaultLanguage.find(code()) != otherDefaultLanguage.end())
+         return LanguageCode(otherDefaultLanguage[code()]);
+           
       if ( _country.hasCode() )
         return _language;