soc.2009.transport: 5cd40461: Install locales to 'share'

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Tue Jul 21 03:35:22 EDT 2009


-----------------------------------------------------------------
Revision: 5cd40461b074895f53f68961c62dcbb55fd4b80d
Ancestor: 45e0e898d4248f71e9ee20587bc9507dd07f9fdc
Author: hanzz at soc.pidgin.im
Date: 2009-07-21T07:29:37
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/5cd40461b074895f53f68961c62dcbb55fd4b80d

Modified files:
        CMakeLists.txt cmake_install.cmake localization.cpp

ChangeLog: 

Install locales to 'share'

-------------- next part --------------
============================================================
--- CMakeLists.txt	8471b8139812f5cf00143fa00197d2976fbfc15d
+++ CMakeLists.txt	bb33467e954e80ef627626a801b26796c2426c31
@@ -149,6 +149,10 @@
 	DESTINATION /etc/highflyer/
     )
 
+INSTALL(FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/locales/cs.po
+	DESTINATION share/highflyer/locales
+    )
 
 # install(FILES
 # 	${CMAKE_CURRENT_SOURCE_DIR}/data/LICENSE.txt
============================================================
--- cmake_install.cmake	d1753f10529f6d9ba2b89bad569cc55ba56750c1
+++ cmake_install.cmake	510f3c8936854dc70dfa0c1e92452d007afd4939
@@ -54,6 +54,10 @@ ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${
   FILE(INSTALL DESTINATION "/etc/highflyer" TYPE FILE FILES "/home/hanzz/code/transport/highflyer.cfg")
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" MATCHES "^(Unspecified)$")
 
+IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" MATCHES "^(Unspecified)$")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/highflyer/locales" TYPE FILE FILES "/home/hanzz/code/transport/locales/cs.po")
+ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" MATCHES "^(Unspecified)$")
+
 IF(CMAKE_INSTALL_COMPONENT)
   SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
 ELSE(CMAKE_INSTALL_COMPONENT)
============================================================
--- localization.cpp	7bc66473c80a1c8cfc22ce91702914a5fc4998f8
+++ localization.cpp	1a834fc9305adc6ca75ccc139d10610bdb0f54bc
@@ -55,7 +55,9 @@ bool Localization::loadLocale(const std:
 	if (g_hash_table_lookup(m_locales, lang.c_str()))
 		return true;
 
-	pofile = po_file_read (std::string("locales/" + lang + ".po").c_str(), error_handle);
+	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);
 	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";


More information about the Commits mailing list