Le dimanche 8 Août 2004 17:19, Jean-Marc Lasgouttes a écrit :
> I propose to apply this. The only problem I see is that when the locale is
> ar (arabic) or iw (hebrew[*]), all the interface is changed to be
> right-to-left, which looks a bit stupid considering that LyX does not have
> a proper localization for these languages. RtL users, your input is
> welcome: what should we do here?

I applied it, along with a setReverseLayout(false). If RtL people clamour to 
have their reversed layout back, I'll remove it.

Here is also an adaptation to 1.3.X, which I will probably apply.

JMarc

Index: src/frontends/qt2/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v
retrieving revision 1.389.2.51
diff -u -r1.389.2.51 ChangeLog
--- src/frontends/qt2/ChangeLog	21 Jun 2004 08:55:49 -0000	1.389.2.51
+++ src/frontends/qt2/ChangeLog	8 Aug 2004 22:23:36 -0000
@@ -1,3 +1,10 @@
+2004-08-08  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* Makefile.am (AM_CXXFLAGS): do not disable QTranslator code
+
+	* lyx_gui.C (parse_init): install a translator for Qt native
+	strings.
+
 2004-06-21  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* QCitation.[Ch]: add validation (fix bug 1617).
Index: src/frontends/qt2/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/Makefile.am,v
retrieving revision 1.71
diff -u -r1.71 Makefile.am
--- src/frontends/qt2/Makefile.am	13 Jan 2003 10:39:17 -0000	1.71
+++ src/frontends/qt2/Makefile.am	8 Aug 2004 22:23:36 -0000
@@ -12,7 +12,7 @@
 	$(FRONTEND_INCLUDES) $(BOOST_INCLUDES) \
 	-I$(top_srcdir)/src/frontends/controllers
 
-AM_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_TRANSLATION
+AM_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR
 
 libqt2_la_SOURCES = \
 	Alert_pimpl.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.30.2.4
diff -u -r1.30.2.4 lyx_gui.C
--- src/frontends/qt2/lyx_gui.C	15 Jan 2004 15:13:39 -0000	1.30.2.4
+++ src/frontends/qt2/lyx_gui.C	8 Aug 2004 22:23:38 -0000
@@ -53,6 +53,8 @@
 #include <qapplication.h>
 #include <qwidget.h>
 #include <qpaintdevicemetrics.h>
+#include <qtranslator.h>
+#include <qtextcodec.h>
 
 #include <fcntl.h>
 #include <cstdlib>
@@ -143,7 +145,23 @@
 
 void lyx_gui::parse_init(int & argc, char * argv[])
 {
-	static LQApplication a(argc, argv);
+	static LQApplication app(argc, argv);
+
+#if QT_VERSION >= 0x030200
+        // install translation file for Qt built-in dialogs
+	// These are only installed since Qt 3.2.x
+        static QTranslator qt_trans(0);
+        if (qt_trans.load(QString("qt_") + QTextCodec::locale(),
+			  qInstallPathTranslations())) {
+		app.installTranslator(&qt_trans);
+		lyxerr[Debug::GUI]
+			<< "Successfully installed Qt translations for locale "
+			<< QTextCodec::locale() << std::endl;
+	} else
+		lyxerr[Debug::GUI]
+			<< "Could not find  Qt translations for locale "
+			<< QTextCodec::locale() << std::endl;
+#endif
 
 	using namespace grfx;
 

Reply via email to