[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| This change makes Makefile.in.in also look at qt4 ui files.
| 
| In addition to that it changes the qt3 ui parsing to _not_ handle
| caption names. I am not sure if this is wanted or not, but at least
| the current captions are just bogus, so either we change them into
| something useful, or we remove them completely as per this patch.
| 
|     <property name="caption">
|         <string>BiblioModuleBase</string>
|     </property>
| 
| Should I commit with both changes or drop the change to qt3 parsing?

Perhaps I should add the patch as well...

Index: Makefile.in.in
===================================================================
--- Makefile.in.in	(revision 15034)
+++ Makefile.in.in	(working copy)
@@ -373,11 +373,11 @@
 	     sort | uniq ) > [EMAIL PROTECTED] \
 	&& mv [EMAIL PROTECTED] $@
 
-l10n_pots: qt_l10n.pot layouts_l10n.pot languages_l10n.pot ui_l10n.pot
+l10n_pots: qt3_l10n.pot qt4_l10n.pot layouts_l10n.pot languages_l10n.pot ui_l10n.pot
 	cat $^ | \
 	msguniq -o $(DOMAIN).po && rm -f  $^
 
-qt_l10n.pot: $(top_srcdir)/src/frontends/qt3/ui/*.ui
+qt3_l10n.pot: $(top_srcdir)/src/frontends/qt3/ui/*.ui
 	LC_ALL=C ; export LC_ALL ; \
 	$(AWK) -v top_srcdir="$(top_srcdir)" ' \
 		function fixupfilename() \
@@ -388,7 +388,8 @@
 			previousline=""; \
 		} \
 		{ \
-			if (!(previousline ~ /^ *< *property  *name *= *"shortcut" *> *$$/) \
+			if ((!(previousline ~ /^ *< *property  *name *= *"shortcut" *> *$$/) && \
+			    !(previousline ~ /^ *< *property  *name *= *"caption" *> *$$/)) \
 			    && $$0 ~ /<string>/) { \
 				line=$$0; \
 				sub(/.*<string>/, "", line); \
@@ -406,6 +407,35 @@
 		}' \
 	${top_srcdir}/src/frontends/qt3/ui/*.ui > $@
 
+qt4_l10n.pot: $(top_srcdir)/src/frontends/qt4/ui/*.ui
+	LC_ALL=C ; export LC_ALL ; \
+	$(AWK) -v top_srcdir="$(top_srcdir)" ' \
+		function fixupfilename() \
+		{\
+			return substr(FILENAME, length(top_srcdir "/") + 1);\
+		}\
+		BEGIN { \
+			previousline=""; \
+		} \
+		{ \
+			if (!(previousline ~ /^ *< *property  *name *= *"shortcut" *> *$$/) \
+			    && $$0 ~ /<string>/) { \
+				line=$$0; \
+				sub(/.*<string>/, "", line); \
+				sub(/<\/string>.*/, "", line); \
+				gsub(/&amp;/, "\\&", line); \
+				gsub(/&lt;/, "<", line); \
+				gsub(/&gt;/, ">", line); \
+				gsub(/"/, "\\\"", line); \
+				if (length(line) > 0) { \
+					printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
+					fixupfilename(), FNR, line); \
+				} \
+			} \
+			previousline=$$0; \
+		}' \
+	${top_srcdir}/src/frontends/qt4/ui/*.ui > $@
+
 layouts_l10n.pot: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc
 	LC_ALL=C ; export LC_ALL ; \
 	$(AWK) -v top_srcdir="$(top_srcdir)" ' \
-- 
        Lgb

Reply via email to