>>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Angus Leeming <[EMAIL PROTECTED]> writes:
>> Ok, the script below works for me with $ awk -v top_srcdir='.' -f
>> trial.awk \ ./src/frontends/qt3/ui/QPrefDisplayModule.ui

Angus> Jean-Marc, has this one slipped by your radar? I thought you
Angus> wanted to remove this line noise from the .po files?

No, it did not, but I have a stack-based radar...

Here is what I have in my tree. I need to actually test it before
committing.

JMarc

Index: po/Makefile.in.in
===================================================================
--- po/Makefile.in.in	(revision 14637)
+++ po/Makefile.in.in	(working copy)
@@ -377,6 +377,7 @@ l10n_pots: qt_l10n.pot layouts_l10n.pot 
 	cat $^ | \
 	msguniq -o $(DOMAIN).po && rm -f  $^
 
+
 qt_l10n.pot: $(top_srcdir)/src/frontends/qt3/ui/*.ui
 	LC_ALL=C ; export LC_ALL ; \
 	$(AWK) -v top_srcdir="$(top_srcdir)" ' \
@@ -384,18 +385,25 @@ qt_l10n.pot: $(top_srcdir)/src/frontends
 		{\
 			return substr(FILENAME, length(top_srcdir "/") + 1);\
 		}\
-		/<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",\
+		BEGIN { \
+			previousline=""; \
+		} \
+		{ \
+			if (previousline ~ /^ *< *property  *name *= *"text" *> *$/ \
+			    && $0 ~ /<string>/) { \
+				line=$0; \
+				sub(/.*<string>/, "", line); \
+				sub(/<\/string>.*/, "", line); \
+				gsub(/&/, "\\&", line); \
+				gsub(/</, "<", line); \
+				gsub(/>/, ">", line); \
+				gsub(/"/, "\\\"", line); \
+				if (length(line) > 0) { \
+					printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
 					fixupfilename(), FNR, line); \
+				} \
 			} \
+			previousline=$0; \
 		}' \
 	${top_srcdir}/src/frontends/qt3/ui/*.ui > $@
 

Reply via email to