]> git.lyx.org Git - lyx.git/blobdiff - po/Makefile.in.in
Remove hard coding of command layouts.
[lyx.git] / po / Makefile.in.in
index 4b056c4904c6c4c90cca614a4c6a68130b2dc6ea..693dc1893d2281d65b6b7e5b56ef0d4db615f6ca 100644 (file)
@@ -49,7 +49,7 @@ POFILES = @POFILES@
 GMOFILES = @GMOFILES@
 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
 $(POFILES) $(GMOFILES) xforms_l10n.pot qt_l10n.pot layouts_l10n.pot \
-languages_l10n.pot default_ui_l10n.pot
+languages_l10n.pot ui_l10n.pot
 
 POTFILE_IN_DEPS = $(shell find $(top_srcdir)/src -name Makefile.am)
 
@@ -201,12 +201,12 @@ ${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS)
        && ( cd $(top_srcdir); \
             grep -l "_(\".*\")" `find src -name \*.[hHC] -print` |\
             sed -e '/xforms.forms/d' | \
-            sort -f -n | uniq ) > $@-t \
+            LC_COLLATE=C sort | uniq ) > $@-t \
        && mv $@-t $@
 
 
-l10n_pots: $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/default_ui_l10n.pot
-       cat $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/default_ui_l10n.pot | \
+l10n_pots: $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/ui_l10n.pot
+       cat $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/ui_l10n.pot | \
        msguniq -o $(PACKAGE).po
 
 $(srcdir)/xforms_l10n.pot: $(top_srcdir)/src/frontends/xforms/forms/*.fd
@@ -237,6 +237,7 @@ $(srcdir)/qt_l10n.pot: $(top_srcdir)/src/frontends/qt2/ui/*.ui
                     gsub(/&/, "\\&", line); \
                     gsub(/&lt;/, "<", line); \
                     gsub(/&gt;/, ">", line); \
+                    gsub(/\"/, "\\\"", line); \
                     if (length(line) > 0) \
                              printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n",\
                     FILENAME, FNR, line); \
@@ -265,14 +266,15 @@ $(srcdir)/languages_l10n.pot: $(top_srcdir)/lib/languages
                 next; \
             } \
            { \
-                lang=$$3; \
+                match($$0,"\"[^\"]*\""); \
+                lang=substr($$0,RSTART,RLENGTH); \
                gsub(/\"/, "", lang); \
                printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
                        FILENAME, FNR, lang); \
            } \
             '  $(top_srcdir)/lib/languages > $@
 
-$(srcdir)/default_ui_l10n.pot: $(top_srcdir)/lib/ui/default.ui
+$(srcdir)/ui_l10n.pot: $(top_srcdir)/lib/ui/*.ui
        awk ' \
            /^[^#]*Submenu/ { \
                line=$$0; \
@@ -281,6 +283,13 @@ $(srcdir)/default_ui_l10n.pot: $(top_srcdir)/lib/ui/default.ui
                printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
                        FILENAME, FNR, line); \
             } \
+           /^[^#]*Toolbar/ { \
+               line=$$0; \
+                sub(/[^"]*"/, "", line); \
+                sub(/".*/, "", line); \
+               printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
+                       FILENAME, FNR, line); \
+            } \
             /^[^#]*Item/ { \
                line=$$0; \
                 sub(/[^"]*"/, "", line); \
@@ -288,7 +297,7 @@ $(srcdir)/default_ui_l10n.pot: $(top_srcdir)/lib/ui/default.ui
                printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
                        FILENAME, FNR, line); \
             } \
-            ' $(top_srcdir)/lib/ui/default.ui > $@
+            ' $(top_srcdir)/lib/ui/*.ui > $@
 
 # 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.