[mapguide-commits] r6429 - trunk/MgDev/Web/src/PhpApi
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Jan 16 04:24:06 EST 2012
Author: liuar
Date: 2012-01-16 01:24:06 -0800 (Mon, 16 Jan 2012)
New Revision: 6429
Modified:
trunk/MgDev/Web/src/PhpApi/PhpLocalizer.cpp
Log:
Fix Ticket #1915 Labels failed to display for flexible web layout.
Modified: trunk/MgDev/Web/src/PhpApi/PhpLocalizer.cpp
===================================================================
--- trunk/MgDev/Web/src/PhpApi/PhpLocalizer.cpp 2012-01-13 17:07:18 UTC (rev 6428)
+++ trunk/MgDev/Web/src/PhpApi/PhpLocalizer.cpp 2012-01-16 09:24:06 UTC (rev 6429)
@@ -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