bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint.mk: let packages tweak sc_po_check pattern


From: Eric Blake
Subject: [PATCH] maint.mk: let packages tweak sc_po_check pattern
Date: Fri, 26 Oct 2012 10:31:13 -0600

libosinfo wants to look for XML files with translation markers
of the form <_name>string to translate</_name>.  Rather than
globally adding this to the regex, I thought it would be easier
to make it possible for cfg.mk to override the default pattern.
https://www.redhat.com/archives/virt-tools-list/2012-October/msg00270.html

* top/maint.mk (sc_po_check): Add files-with-translation, to allow
finding files with other translation markers.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog    | 6 ++++++
 top/maint.mk | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 32c4c3e..a379c32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-10-26  Eric Blake  <address@hidden>
+
+       maint.mk: let packages tweak sc_po_check pattern
+       * top/maint.mk (sc_po_check): Add translation-markers, to allow
+       finding files with other translation markers.
+
 2012-10-16  Paul Eggert  <address@hidden>

        euidaccess: speed up 'configure' on GNU hosts
diff --git a/top/maint.mk b/top/maint.mk
index e52deb4..6522c6b 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1121,9 +1121,11 @@ fix_po_file_diag = \
 'you have changed the set of files with translatable diagnostics;\n\
 apply the above patch\n'

-# Verify that all source files using _() are listed in po/POTFILES.in.
+# Verify that all source files using _() (more specifically, files that
+# contain the ERE translations-markers) are listed in po/POTFILES.in.
 po_file ?= $(srcdir)/po/POTFILES.in
 generated_files ?= $(srcdir)/lib/*.[ch]
+translation-markers ?= \b(N?_|gettext *)\([^)"]*("|$$)
 sc_po_check:
        @if test -f $(po_file); then                                    \
          grep -E -v '^(#|$$)' $(po_file)                               \
@@ -1143,7 +1145,7 @@ sc_po_check:
            esac;                                                       \
            files="$$files $$file";                                     \
          done;                                                         \
-         grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files          \
+         grep -E -l '$(translation-markers)' $$files                   \
            | sed 's|^$(_dot_escaped_srcdir)/||' | sort -u > address@hidden;    
\
          diff -u -L $(po_file) -L $(po_file) address@hidden address@hidden     
                \
            || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; };   \
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]