Michael Gerz wrote:

> Hi,
> 
> this patch makes Qt strings translateable again (at least when using
> scons).
> 
> Can I commit?

No. Adding qt_helpers.h to all includes is wrong. The attached patch
contains an example how to do it correctly (and how it was done in qt3) and
fixes the autotools part at the same time.
My uic (version 4.1.4) generates calls to the translation function with a
second argument. Did you not need that? I have no idea what it is supposed
to do.


Georg
Index: src/frontends/qt4/qt_helpers.C
===================================================================
--- src/frontends/qt4/qt_helpers.C	(Revision 15777)
+++ src/frontends/qt4/qt_helpers.C	(Arbeitskopie)
@@ -155,8 +155,9 @@ void qstring_to_ucs4(QString const & qst
 }
 
 
-QString const qt_(char const * str)
+QString const qt_(char const * str int dummy)
 {
+	// FIXME: Look up in uic docs what dummy is supposed to do
 	return toqstr(_(str));
 }
 
Index: src/frontends/qt4/qt_helpers.h
===================================================================
--- src/frontends/qt4/qt_helpers.h	(Revision 15777)
+++ src/frontends/qt4/qt_helpers.h	(Arbeitskopie)
@@ -104,7 +104,7 @@ void qstring_to_ucs4(QString const & qst
  *
  * Use this in qt4/ instead of qt_()
  */
-QString const qt_(char const * str);
+QString const qt_(char const * str, int dummy = 0);
 
 
 /**
Index: src/frontends/qt4/ui/QAskForTextUi.ui
===================================================================
--- src/frontends/qt4/ui/QAskForTextUi.ui	(Revision 15777)
+++ src/frontends/qt4/ui/QAskForTextUi.ui	(Arbeitskopie)
@@ -103,6 +103,9 @@
   </layout>
  </widget>
  <pixmapfunction></pixmapfunction>
+ <includes>
+  <include location="local" >qt_helpers.h</include>
+ </includes>
  <resources/>
  <connections/>
 </ui>
Index: src/frontends/qt4/ui/Makefile.am
===================================================================
--- src/frontends/qt4/ui/Makefile.am	(Revision 15777)
+++ src/frontends/qt4/ui/Makefile.am	(Arbeitskopie)
@@ -8,7 +8,7 @@ EXTRA_DIST = $(UIFILES)
 BUILT_SOURCES = $(UIFILES:.ui=.h)
 
 # Use _() for localization instead of tr() or trUtf8()
-UICFLAGS=-tr qt_
+UIC4FLAGS=-tr lyx::qt_
 
 %.h: %.ui
 	$(UIC4) $(UIC4FLAGS) $< -o $@

Reply via email to