Wireshark-dev: Re: [Wireshark-dev] QtShark Translation
From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Mon, 5 Mar 2012 17:48:01 +0100
On Mon, Mar 05, 2012 at 10:10:40AM +0100, Alexis La Goutte wrote:
> > You might try the following instructions for cmake:
> > http://www.cmake.org/Wiki/CMake:How_To_Build_Qt4_Software
> > but I'd be willing to do this once internationalization is committed.
> >
> 
> I tried but... no work ! (for the moment...)

The attached patch will make it (amost) work (this assumes some of the renames
I proposed but you will get the idea from it).

It will cause compilation to fail unless either
a) source dir is also the build dir or
b) you manually create a link for qtshark_fr.qm into the source dir

I will eventually look into the dependency problem, but for now I'm happy
it works at all ....

Ciao
 Jörg
-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 41354)
+++ CMakeLists.txt	(working copy)
@@ -92,15 +92,22 @@
 
 set(QTSHARK_QRC
 	display_filter.qrc
+	i18n.qrc
 	toolbar.qrc
 	welcome.qrc
 )
 
+set(QTSHARK_TS
+	qtshark_fr.ts
+)
+
 include_directories(
         ${CMAKE_CURRENT_SOURCE_DIR}
         ${CMAKE_CURRENT_BINARY_DIR}
 )
 
+QT4_ADD_TRANSLATION(QTSHARK_TS_QM ${QTSHARK_TS})
+
 QT4_ADD_RESOURCES(QTSHARK_QRC_SRC ${QTSHARK_QRC})
 
 QT4_WRAP_UI(QTSHARK_UI_SRC ${QTSHARK_UI})
@@ -132,6 +139,7 @@
 	${QTSHARK_UI_SRC}
 	${QTSHARK_MOC_SRC}
 	${QTSHARK_QRC_SRC}
+	${QTSHARK_TS_QM}
 )
 set_target_properties(qtui PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
 
Index: wireshark_application.cpp
===================================================================
--- wireshark_application.cpp	(revision 41354)
+++ wireshark_application.cpp	(working copy)
@@ -264,6 +264,7 @@
     wsApp = this;
 
     Q_INIT_RESOURCE(display_filter);
+    Q_INIT_RESOURCE(i18n);
     Q_INIT_RESOURCE(toolbar);
     Q_INIT_RESOURCE(welcome);