soc.2009.transport: a8262c95: Using INSTALL_DIR in localization loader

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Tue Jul 21 16:25:34 EDT 2009


-----------------------------------------------------------------
Revision: a8262c95640bc1cbafc4593be3b8dd19a26af9ce
Ancestor: bccf59578d6a70e3874dd1a76e38d64a023862f5
Author: hanzz at soc.pidgin.im
Date: 2009-07-21T20:21:58
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/a8262c95640bc1cbafc4593be3b8dd19a26af9ce

Modified files:
        localization.cpp main.cpp

ChangeLog: 

Using INSTALL_DIR in localization loader

-------------- next part --------------
============================================================
--- localization.cpp	1a834fc9305adc6ca75ccc139d10610bdb0f54bc
+++ localization.cpp	461c7f5aab6cc8255f1c6010d96a07a17eea8313
@@ -20,6 +20,7 @@
 
 #include "localization.h"
 #include "log.h"
+#include "transport_config.h"
 
 Localization::Localization() {
 	m_locales = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_hash_table_destroy);
@@ -55,9 +56,7 @@ bool Localization::loadLocale(const std:
 	if (g_hash_table_lookup(m_locales, lang.c_str()))
 		return true;
 
-	pofile = po_file_read (std::string("/usr/share/highflyer/locales/" + lang + ".po").c_str(), error_handle);
-	if (pofile == NULL)
-		pofile = po_file_read (std::string("/usr/local/share/highflyer/locales/" + lang + ".po").c_str(), error_handle);
+	pofile = po_file_read (g_build_filename(INSTALL_DIR, "share", "highflyer", "locales", std::string(lang + ".po").c_str(), NULL), error_handle);
 	if (pofile != NULL) {
 		GHashTable *locale = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 		Log().Get("Localization") << lang  << " locale found";
============================================================
--- main.cpp	08d86e0f825fec14a5ffb2d847270980ef0279dd
+++ main.cpp	4c30b5fccbaa9c3a0484da346818baafe2c34020
@@ -1428,7 +1428,6 @@ int main( int argc, char* argv[] ) {
 
 GlooxMessageHandler* GlooxMessageHandler::m_pInstance = NULL;
 int main( int argc, char* argv[] ) {
-	std::cout << INSTALL_DIR << "\n";
 	if (argc != 2)
 		std::cout << "Usage: " << std::string(argv[0]) << " config_file_name\n";
 	else {


More information about the Commits mailing list