[mapguide-commits] r6431 - sandbox/adsk/2.4jbeta2/Web/src/PhpApi

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jan 16 04:26:03 EST 2012


Author: liuar
Date: 2012-01-16 01:26:03 -0800 (Mon, 16 Jan 2012)
New Revision: 6431

Modified:
   sandbox/adsk/2.4jbeta2/Web/src/PhpApi/PhpLocalizer.cpp
Log:
port the fix of Ticket #1915 to adsk2.4jedi beta2 branch.

Modified: sandbox/adsk/2.4jbeta2/Web/src/PhpApi/PhpLocalizer.cpp
===================================================================
--- sandbox/adsk/2.4jbeta2/Web/src/PhpApi/PhpLocalizer.cpp	2012-01-16 09:25:18 UTC (rev 6430)
+++ sandbox/adsk/2.4jbeta2/Web/src/PhpApi/PhpLocalizer.cpp	2012-01-16 09:26:03 UTC (rev 6431)
@@ -36,22 +36,25 @@
         locale = english;
     else
         strlower(locale);
+    
+    string localKey = localizationPath + locale;
 
-    map<string, PSTRBUNDLE>::const_iterator it = languages.find(locale);
+    map<string, PSTRBUNDLE>::const_iterator it = languages.find(localKey);
+    
     if (it == languages.end()) {
         FILE* f = NULL;
-        string fname = localizationPath + locale;
+        string fname = localKey;
         f = fopen(fname.c_str(), "r");
         if(f == NULL) {  // assume file doesn't exists
             // requested locale is not supported, default to English
-            it = languages.find(english);
+            it = languages.find(localizationPath + english);
             if(it != languages.end())
                 return it->second;
             fname = localizationPath + english;
             f = fopen(fname.c_str(), "r");
         }
         PSTRBUNDLE sb = new STRBUNDLE;
-        languages[locale] = sb;
+        languages[localKey] = sb;
         if(f != NULL) {
             char l[MAX_LOC_LEN + 1];
             for(int lc = 0; fgets(l, MAX_LOC_LEN, f) != NULL; lc++) {
@@ -74,7 +77,7 @@
             fclose(f);
         }
     }
-    return languages[locale];
+    return languages[localKey];
 }
 
 static char* Localize(const char* text_, const char* locale_, int os)



More information about the mapguide-commits mailing list