]> git.lyx.org Git - lyx.git/blobdiff - po/Makefile.in.in
po remerge
[lyx.git] / po / Makefile.in.in
index 8ac08b80530d263898f1b3df5c06e1eb42c69889..2f0bc2c73c8840d75e6325981f9d57d993f00be7 100644 (file)
@@ -53,6 +53,8 @@ DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
 $(POFILES) $(GMOFILES) \
 $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
 
+DISTFILES.extra1 = lyx_pot.py
+
 POTFILE_IN_DEPS = $(shell find $(top_srcdir)/src -name Makefile.am)
 
 POTFILES = \
@@ -369,136 +371,37 @@ ${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS)
        LC_ALL=C ; export LC_ALL ; \
        rm -f $@-t \
        && ( cd $(top_srcdir); \
-            grep -l "_(\".*\")" `find src \( -name '*.[Cch]' -o -name '*.C.in' \) -print` |\
-            grep -v -e "src/support/package.C$$" |\
+            grep -l "_(\".*\")" `find src \( -name '*.h' -o -name '*.cpp' -o -name '*.cpp.in' \) -print` |\
+            grep -v -e "src/support/Package.cpp$$" |\
             sort | uniq ) > $@-t \
        && mv $@-t $@
 
-l10n_pots: qt4_l10n.pot layouts_l10n.pot languages_l10n.pot ui_l10n.pot
+l10n_pots: qt4_l10n.pot layouts_l10n.pot languages_l10n.pot ui_l10n.pot external_l10n.pot
        cat $^ | \
        msguniq -o $(DOMAIN).po && rm -f  $^
 
 
 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 > $@
+       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t qt4 ${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)" ' \
-               function fixupfilename() \
-               {\
-                       return substr(FILENAME, length(top_srcdir "/") + 1);\
-               }\
-               /^Style / { \
-                       line=$$0; \
-                       sub(/Style /, "", line); \
-                       gsub(/"/, "", line); \
-                       gsub(/_/, " ", line); \
-                       printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
-                               fixupfilename(), FNR, line); \
-               } \
-               /LabelString[A-Za-z]*/ { \
-                       line=$$0; \
-                       sub(/[[:space:]]*LabelString[A-Za-z]*[[:space:]]*/, "", line); \
-                       gsub(/"/, "", line); \
-                       if (line != "") \
-                         printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
-                                fixupfilename(), FNR, line); \
-               } \
-               /GuiName/ { \
-                       line=$$0; \
-                       sub(/[[:space:]]*GuiName[[:space:]]*/, "", line); \
-                       gsub(/"/, "", line); \
-                       printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
-                               fixupfilename(), FNR, line); \
-               } \
-               /ListName/ { \
-                       line=$$0; \
-                       sub(/[[:space:]]*ListName[[:space:]]*/, "", line); \
-                       gsub(/"/, "", line); \
-                       printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
-                               fixupfilename(), FNR, line); \
-               }' \
-       ${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc \
-       | sed 's/\\/\\\\/g' > $@
+       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t layouts ${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc
 
 languages_l10n.pot: $(top_srcdir)/lib/languages
-       $(AWK) -v top_srcdir="$(top_srcdir)" ' \
-               function fixupfilename() \
-               {\
-                       return substr(FILENAME, length(top_srcdir "/") + 1);\
-               }\
-               /^#/ { \
-                       next; \
-               } \
-               { \
-                       match($$0,"\"[^\"]*\""); \
-                       lang=substr($$0,RSTART,RLENGTH); \
-                       gsub(/"/, "", lang); \
-                       printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
-                       fixupfilename(), FNR, lang); \
-               }' \
-       ${top_srcdir}/lib/languages > $@
+       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t languages ${top_srcdir}/lib/languages
 
 ui_l10n.pot: $(top_srcdir)/lib/ui/*.ui $(top_srcdir)/lib/ui/*.inc
        LC_ALL=C ; export LC_ALL ; \
-       $(AWK) -v top_srcdir="$(top_srcdir)" ' \
-               function fixupfilename() \
-               {\
-                       return substr(FILENAME, length(top_srcdir "/") + 1);\
-               }\
-               /^[^#]*Submenu/ { \
-                       line=$$0; \
-                       sub(/[^"]*"/, "", line); \
-                       sub(/".*/, "", line); \
-                       printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
-                               fixupfilename(), FNR, line); \
-               } \
-               /^[^#]*Toolbar[^s]/ { \
-                       line=$$0; \
-                       sub(/[^"]*"[^"]*"[^"]"*/, "", line); \
-                       sub(/".*/, "", line); \
-                       printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
-                               fixupfilename(), FNR, line); \
-               } \
-               /^[^#]*Item/ { \
-                       line=$$0; \
-                       sub(/[^"]*"/, "", line); \
-                       sub(/".*/, "", line); \
-                       printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
-                               fixupfilename(), FNR, line); \
-               }' \
-       ${top_srcdir}/lib/ui/*.ui ${top_srcdir}/lib/ui/*.inc > $@
+       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t ui ${top_srcdir}/lib/ui/*.ui ${top_srcdir}/lib/ui/*.inc
 
 i18n.php: $(POFILES) postats.sh
        (cd $(srcdir) ; ./postats.sh $(POFILES)) >$@
 
+external_l10n.pot: $(top_srcdir)/lib/external_templates
+       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t external ${top_srcdir}/lib/external_templates
+
 force:
 
 # Tell versions [3.59,3.63) of GNU make not to export all variables.