]> git.lyx.org Git - features.git/commitdiff
use sed instead of awk for some stuff. Only translate stuff the user will see instead...
authorAllan Rae <rae@lyx.org>
Sun, 14 Jan 2001 04:43:42 +0000 (04:43 +0000)
committerAllan Rae <rae@lyx.org>
Sun, 14 Jan 2001 04:43:42 +0000 (04:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1333 a592a061-630c-0410-9148-cb99ea01b6c8

po/ChangeLog
po/Makefile.in.in
po/POTFILES.in

index 83eb0b59acbade6187198edf1e671a2eeaa81d2c..5ff3997bc462016169294495f108386084f4052a 100644 (file)
@@ -1,6 +1,17 @@
+2001-01-14  Allan Rae  <rae@lyx.org>
+
+       * Makefile.in.in (POTFILES.in): Removed dependency on
+       $(top_srcdir)/src/ext_l10n.h because we need the Makefile to be
+       regenerated _before_ ext_l10n.h is regenerated in order for
+       changes to the ext_l10n.h rule to take effect.
+       ($(top_srcdir)/src/ext_l10n.h): moved so Makefile rule has precedence.
+       Rewrote to use sed exclusively instead of awkward awk scripts.  Fixed
+       several bugs in the process.  We now only translate stuff that
+       should be translated.
+
 2001-01-13  Allan Rae  <rae@lyx.org>
 
-       * Makefile (POTFILE_IN_DEPS): remove the GNU make specific :=
+       * Makefile.in.in (POTFILE_IN_DEPS): remove the GNU make specific :=
 
 2001-01-08  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
index bd738d83d3aae1957e8da4e3a00a4fffb4b7cff5..1c7c56ae01cf68a1bd063d07aa36a4cd2c091016 100644 (file)
@@ -109,13 +109,6 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
        fi
        cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
 
-$(top_srcdir)/src/ext_l10n.h: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc $(top_srcdir)/lib/ui/default.ui $(top_srcdir)/lib/languages
-       grep -i -E "submenu|item|optitem" $(top_srcdir)/lib/ui/default.ui | cut -d '"' -f 2 | \
-               awk '$$0 {printf "_(\"%s\");\n", $$0}' > $@
-       grep -i -E "[ ]*style .+$$" $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc | \
-               cut -d ' ' -f 2 | sort | uniq | awk '$$0 {printf "_(\"%s\");\n", $$0}' >> $@
-       awk -F '"' '$$2 {printf "_(\"%s\");\n", $$2}' $(top_srcdir)/lib/languages >> $@
-
 install: install-exec install-data
 install-exec:
 install-data: install-data-@USE_NLS@
@@ -236,13 +229,14 @@ update-po: Makefile
          fi; \
        done
 
-${srcdir}/POTFILES.in: $(top_srcdir)/src/ext_l10n.h $(POTFILE_IN_DEPS)
+${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS)
        rm -f $@-t \
        && ( cd $(top_srcdir); \
             grep -l -E "_\(\".*\"\)" `find src -name \*.[hHC]` | \
             awk 'BEGIN {FS= ":"} {print $$1}' | \
             sed -e '/xforms.forms/d' | \
             sort -f -d | uniq ) > $@-t \
+       && echo "src/ext_l10n.h" >> $@-t \
        && mv $@-t $@
 
 POTFILES: POTFILES.in
@@ -264,6 +258,16 @@ Makefile: Makefile.in.in ../config.status POTFILES
          && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
               $(SHELL) ./config.status
 
+$(top_srcdir)/src/ext_l10n.h: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc $(top_srcdir)/lib/ui/default.ui $(top_srcdir)/lib/languages
+       sed < $(top_srcdir)/lib/ui/default.ui -n \
+               -e 's/.*[sS]ub[mM]enu[^"]*\("[^"]*"\).*/_(\1);/p' \
+               -e 's/.*[iI]tem[^"]*\("[^"]*"\).*/_(\1);/p' \
+               > $@
+       cat $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc | \
+               sed -n -e 's/^[sS]tyle[ ]*\([^ ]*\)$$/_("\1");/p' | \
+               sort | uniq >> $@
+       sed < $(top_srcdir)/lib/languages -e '/^#/d' -e 's/[^"]*\("[A-Za-z0-9][^"]*"\).*/_(\1);/' >> $@
+
 # Tell versions [3.59,3.63) of GNU make not to export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 59c622c5603bf49229119b68e9af317e5922d8d6..48e5b65b0a67e9e78bdcb3f24c68b197a716b6ea 100644 (file)
@@ -12,7 +12,6 @@ src/credits_form.C
 src/CutAndPaste.C
 src/debug.C
 src/exporter.C
-src/ext_l10n.h
 src/filedlg.C
 src/FontLoader.C
 src/form1.C
@@ -149,3 +148,4 @@ src/support/path.h
 src/tabular.C
 src/text2.C
 src/text.C
+src/ext_l10n.h