[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r2215: Add a 'make lupdate' target to lupdate all the translations. (in trunk: . src/vidalia/i18n)



Author: edmanm
Date: 2007-12-14 20:37:23 -0500 (Fri, 14 Dec 2007)
New Revision: 2215

Modified:
   trunk/
   trunk/VidaliaMacros.cmake
   trunk/src/vidalia/i18n/CMakeLists.txt
Log:
 r2301@lysithea:  edmanm | 2007-12-14 20:36:41 -0500
 Add a 'make lupdate' target to lupdate all the translations.



Property changes on: trunk
___________________________________________________________________
 svk:merge ticket from /local/vidalia/trunk [r2301] on 0108964c-5b0b-4c9e-969f-e2288315d100

Modified: trunk/VidaliaMacros.cmake
===================================================================
--- trunk/VidaliaMacros.cmake	2007-12-14 02:20:14 UTC (rev 2214)
+++ trunk/VidaliaMacros.cmake	2007-12-15 01:37:23 UTC (rev 2215)
@@ -33,6 +33,17 @@
 endif(NOT QT_LRELEASE_EXECUTABLE)
 
 
+## Search for lupdate
+find_program(QT_LUPDATE_EXECUTABLE NAMES lupdate-qt4 lupdate
+  PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH
+)
+if (NOT QT_LUPDATE_EXECUTABLE)
+  message(FATAL_ERROR
+    "Vidalia could not find lupdate. Please make sure Qt >= 4.1 is installed."
+  )
+endif(NOT QT_LUPDATE_EXECUTABLE)
+
+
 ## We need windres.exe when building on MinGW to compile the .rc file
 if (MINGW)
   find_program(MINGW_WINDRES_EXECUTABLE  NAMES windres.exe ${QT_BINARY_DIR})

Modified: trunk/src/vidalia/i18n/CMakeLists.txt
===================================================================
--- trunk/src/vidalia/i18n/CMakeLists.txt	2007-12-14 02:20:14 UTC (rev 2214)
+++ trunk/src/vidalia/i18n/CMakeLists.txt	2007-12-15 01:37:23 UTC (rev 2215)
@@ -23,7 +23,7 @@
 
 
 ## Vidalia translation files
-qt4_add_translations(vidalia_QMS
+set(vidalia_TS
   vidalia_ar.ts
   vidalia_bg.ts
   vidalia_cs.ts
@@ -44,5 +44,19 @@
   vidalia_zh-cn.ts
   vidalia_zh-tw.ts
 )
+qt4_add_translations(vidalia_QMS ${vidalia_TS})
+
+## Gather a list of all the files that might contain translated strings
+FILE(GLOB_RECURSE translate_SRCS ${Vidalia_SOURCE_DIR}/src/*.cpp)
+FILE(GLOB_RECURSE translate_HDRS ${Vidalia_SOURCE_DIR}/src/*.h)
+FILE(GLOB_RECURSE translate_UIS  ${Vidalia_SOURCE_DIR}/src/*.ui)
+set(translate_SRCS ${translate_SRCS} ${translate_HDRS} ${translate_UIS})
+
+## Create a target that runs lupdate for all the source and UI files
+add_custom_target(lupdate 
+  COMMAND ${QT_LUPDATE_EXECUTABLE} -noobsolete ${translate_SRCS} -ts ${vidalia_TS}
+)
+
+## Create a target that runs lrelease for all the .ts files
 add_custom_target(translations ALL DEPENDS ${vidalia_QMS})