[sword-svn] r1724 - trunk/src/mgr

jansorg at crosswire.org jansorg at crosswire.org
Mon Feb 21 16:12:36 MST 2005


Author: jansorg
Date: 2005-02-21 16:12:34 -0700 (Mon, 21 Feb 2005)
New Revision: 1724

Modified:
   trunk/src/mgr/localemgr.cpp
Log:
load locale files from all augmented paths

Modified: trunk/src/mgr/localemgr.cpp
===================================================================
--- trunk/src/mgr/localemgr.cpp	2005-02-20 23:40:39 UTC (rev 1723)
+++ trunk/src/mgr/localemgr.cpp	2005-02-21 23:12:34 UTC (rev 1724)
@@ -73,6 +73,7 @@
 	char *configPath = 0;
 	char configType = 0;
 	SWBuf path;
+	std::list<SWBuf> augPaths;
 	
 	defaultLocaleName = 0;
 	
@@ -85,7 +86,7 @@
 	else setDefaultLocaleName("en_US");
 
 	if (!iConfigPath)
-		SWMgr::findConfig(&configType, &prefixPath, &configPath);
+		SWMgr::findConfig(&configType, &prefixPath, &configPath, &augPaths);
 	else configPath = (char *)iConfigPath;
 	
 	if (prefixPath) {
@@ -109,6 +110,18 @@
 			loadConfigDir(path.c_str());
 		}
 	}
+	
+	if (augPaths.size()) { //load locale files from all augmented paths
+		std::list<SWBuf>::iterator it = augPaths.begin();
+		std::list<SWBuf>::iterator end = augPaths.end();
+		
+		for (;it != end; ++it) {
+			if (FileMgr::existsDir((*it).c_str(), "locales.d")) {
+				SWBuf path = (*it) + "locales.d";
+				loadConfigDir(path.c_str());
+			}
+		}
+	}
 
 	if (prefixPath)
 		delete [] prefixPath;
@@ -153,7 +166,7 @@
 					}
 					
 					if (!supported) { //not supported
-						delete locale;						
+						delete locale;
 						continue;
 					}
 				



More information about the sword-cvs mailing list