The following patch is supposed to make sure that the qt-internal
strings like in the FileDialog or menu shortcuts get translated (at
least in german and french, the only two translations provided by
trolltech...)/

However, although I thought I followed the recipe, it does say that
the translations got loaded, but nothing else happen... What does this
mean?

JMarc

Index: src/frontends/qt2/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/Makefile.am,v
retrieving revision 1.93
diff -u -r1.93 Makefile.am
--- src/frontends/qt2/Makefile.am	31 Mar 2004 22:09:51 -0000	1.93
+++ src/frontends/qt2/Makefile.am	5 Aug 2004 22:27:51 -0000
@@ -14,7 +14,7 @@
 
 libqt2_la_LDFLAGS = $(QT_LDFLAGS)
 libqt2_la_LIBADD = $(QT_LIB) ui/*.lo moc/*.lo ui/moc/*.lo
-AM_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_TRANSLATION
+AM_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR
 
 libqt2_la_SOURCES = \
 	QDialogView.C \
Index: src/frontends/qt2/lyx_gui.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/lyx_gui.C,v
retrieving revision 1.68
diff -u -r1.68 lyx_gui.C
--- src/frontends/qt2/lyx_gui.C	22 Jul 2004 13:44:40 -0000	1.68
+++ src/frontends/qt2/lyx_gui.C	5 Aug 2004 22:27:51 -0000
@@ -29,6 +29,7 @@
 
 #include "support/lstrings.h"
 #include "support/os.h"
+#include "debug.h"
 
 // Dear Lord, deliver us from Evil, aka the Qt headers
 // Qt defines a macro 'signals' that clashes with a boost namespace.
@@ -50,6 +51,8 @@
 
 #include <qapplication.h>
 #include <qpaintdevicemetrics.h>
+#include <qtranslator.h>
+#include <qtextcodec.h>
 
 using lyx::support::ltrim;
 
@@ -152,7 +155,21 @@
 
 void parse_init(int & argc, char * argv[])
 {
-	static LQApplication a(argc, argv);
+	static LQApplication app(argc, argv);
+
+        // translation file for Qt
+        QTranslator qt( 0 );
+	lyxerr << "file=" << QString( "qt_" ) + QTextCodec::locale()
+	       << ", path=" << qInstallPathTranslations() << std::endl;
+        if (qt.load(QString( "qt_" ) + QTextCodec::locale(),
+		    qInstallPathTranslations())) {
+		app.installTranslator( &qt );
+		lyxerr << "Successfully installed Qt translations for locale "
+		       << QTextCodec::locale() << std::endl;
+	} else
+		lyxerr << "Could not find  Qt translations for locale "
+		       << QTextCodec::locale() << std::endl;
+
 
 	using namespace lyx::graphics;
 

Reply via email to