trans-coord-devel
[Top][All Lists]
Advanced

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

Selectively localized images [was: [gnu.org #604705] self-inconsistent..


From: Ineiev
Subject: Selectively localized images [was: [gnu.org #604705] self-inconsistent...]
Date: Wed, 22 Dec 2010 14:14:59 +0000
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

Ineiev wrote:
Yavor Doganov via RT wrote:
It will insert an artificial gettext message in the POT,
and subsequently in all .po files, but the "translation" won't be put
in the generated .LANG.html.

Indeed, it is not :(

Next iteration, hopefully fixing that issue:
--- GNUmakefile.orig    2010-12-01 15:33:07.000000000 +0000
+++ GNUmakefile 2010-12-22 14:07:59.696528957 +0000
@@ -156,12 +156,33 @@
 endef

+# sed scripts to selectively pass images and links
+# through the translation process
+translate_image_mark=<!-- translate this image -->
+image_alias_mark=i translated_img
+image_alias=s/\($(translate_image_mark)\) *<img/\1 <$(image_alias_mark)/
+image_po_alias=s/\"<img/\"<$(image_alias_mark)/
+image_po_unalias=s/<$(image_alias_mark)/<img/
+
+translate_link_mark=<!-- translate this link -->
+link_alias_mark=i translated_link
+link_alias=s/\($(translate_link_mark)\) *<link/\1 <$(link_alias_mark)/
+link_po_alias=s/\"<link/\"<$(link_alias_mark)/
+link_po_unalias=s/<$(link_alias_mark)/<link/
+
+html_alias="$(image_alias);$(link_alias)"
+html_po_alias="$(image_po_alias);$(link_po_alias)"
+html_po_unalias="$(image_po_unalias);$(link_po_unalias)"
+
 # The command to generate pot file which perform additional checks
 # whether the changes are not trivial (regarding only
 # POT-Creation-Date), in which case the changes are ignored.
 define generate-pot
+$(SED) $(html_alias) < $< > address@hidden
 $(MAILFAIL) $(NOTIFYSKIP) $(web-addr) \
   "[GNUN Error] POT generation of $(subst $(rootdir)/,,$@) failed" \
   $(PO4A_GETTEXTIZE) $(PO4A-XHTMLFLAGS) $(PO4A-GETTEXTIZEFLAGS) \
-  --master $< --po address@hidden
+  --master address@hidden --po address@hidden
+$(SED) --in-place $(html_po_unalias) address@hidden
+$(RM) address@hidden
 if ([ ! -f $@ ] || [ "`diff -U 0 $@ address@hidden | $(GREP) -v 
"^\(---\|+++\|@@\)" \
      | $(GREP) -v '^[-+]\"POT-Creation-Date:' | wc -c`" -ne 0 ]); then \
@@ -175,6 +196,10 @@
 # from a PO file.  The result is further manipulated in the recipes.
 define generate-html
+$(SED) $(html_alias) < $$< > $$<.html.tmp; \
+$(SED) $(html_po_alias) $$$$PO > $$$$PO.tmp; \
 $(PO4A_TRANSLATE) $(PO4A-XHTMLFLAGS) $(PO4A-TRANSLATEFLAGS) \
-  --master $$< --po $$$$PO --localized $$$$OUT
+  --master $$<.html.tmp --po $$$$PO.tmp --localized $$$$OUT; \
+$(SED) --in-place $(html_po_unalias) $$$$OUT; \
+$(RM) $$<.html.tmp $$$$PO.tmp
 endef




reply via email to

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