Pauli Virtanen <[EMAIL PROTECTED]> writes:
| 1. Translatable strings from xforms dialogs are not extracted to
| lyx.pot.
|
| The cause is that src/frontends/xforms/forms/*.C are not added to
| po/POTFILES.in by po/Makefile.in.in. (In 1.2.x these files were added)
|
| The attached 'forms-potfiles.patch' is a dirty hack to solve this: it
| makes sure the source files are autogenerated first, and then adds them
| to POTFILES.in.
Ok, I have another patch for this. With this solution the filename +
line tags in the lyx.pot file stay nice.
Some part of this might be considered a bit hackish.
Btw. how is the localization of strings from Qt realized? Are we
extracting those from the ui files? Should we?
Index: Makefile.in.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/Makefile.in.in,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile.in.in
--- Makefile.in.in 16 Apr 2002 21:59:01 -0000 1.20
+++ Makefile.in.in 8 Dec 2002 20:37:29 -0000
@@ -86,8 +86,8 @@ all-no:
# otherwise packages like GCC can not be built if only parts of the source
# have been downloaded.
-$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in $(top_srcdir)/src/e
xt_l10n.h
- $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
+$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in $(top_srcdir)/src/e
xt_l10n.h xforms_l10n.pot
+ $(XGETTEXT) --join-existing --default-domain=$(PACKAGE) --directory=$(to
p_srcdir) \
--escape --add-comments --keyword=_ --keyword=N_ \
--files-from=$(srcdir)/POTFILES.in \
&& test ! -f $(PACKAGE).po \
@@ -203,6 +203,26 @@ ${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS
sort -f -n | uniq ) > $@-t \
&& echo "src/ext_l10n.h" >> $@-t \
&& mv $@-t $@
+
+
+xforms_l10n.pot: $(top_srcdir)/src/frontends/xforms/forms/*.fd
+ awk ' \
+ BEGIN { \
+ print "msgid \"\""; \
+ print "msgstr \"\""; \
+ print "\"Content-Type: text/plain; charset=ISO-8859-1\\n
\""; \
+ } \
+ /label: / { \
+ if (NF > 1) { \
+ line=$$2;\
+ sub(/label: /,"",line);\
+ printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n"
, FILENAME, FNR, line);\
+ }\
+ }' \
+ `find $(top_srcdir)/src/frontends/xforms/forms -name \*.fd` | \
+ msguniq -o $@
+ cp $@ $(PACKAGE).po
+
$(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 \
--
Lgb