Re: translation of searchtmpl/search.wml
On Sun, Jan 19, 2003 at 11:45:17PM +0900, Tomohiro KUBOTA wrote:
[..]
> I found that target encoding of gettext is defined in
> webwml/english/template/debian/common_tags.wml . Thus, the best way
> is to redefine CHARSET_WML and CHARSET variables before it. (These
> variables are defined in webwml/<language>/.wmlrc files.) The patch
> attached to this mail includes this modification.
> It is also needed that translated search.wml files to be written in
> UTF-8. The following patch includes a note on this point.
At first glance it sounds very good, but I am not sure this is the way
to go, because some strings are not handled by gettext, e.g. see
Catalan strings in webwml/english/template/debian/ctime.wml
There are also several Perl variables in date.pot, which will be
displayed according to current locale, and not UTF-8.
We could certainly play with CUR_LOCALE, but a simpler solution is
to post-process HTML files with iconv and change their charset
field in <meta> tags, see attached patch.
> PS. The content negotiation
> http://search.debian.org/new/index.en.cgi
> http://search.debian.org/new/index.fr.cgi
> seems not work well. Though I am afraid I am wrong, how about
> renaming /org/search.debian.org/etc/search.<lang>.htm into
> renaming /org/search.debian.org/etc/index.<lang>.htm ? The source
> code of mnoGoSearch seems to substitute ".cgi" with ".htm" to
> search the configuration file (src/search.c).
No idea about this one.
Denis
Index: english/searchtmpl/Makefile
===================================================================
RCS file: /cvs/webwml/webwml/english/searchtmpl/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- english/searchtmpl/Makefile 2 Nov 2002 23:36:01 -0000 1.5
+++ english/searchtmpl/Makefile 19 Jan 2003 20:45:33 -0000
@@ -10,8 +10,13 @@
include $(WMLBASE)/Make.lang
+all:: search-convert
search.$(LANGUAGE).html: search.wml $(ENGLISHSRCDIR)/searchtmpl/search.data \
$(ENGLISHSRCDIR)/searchtmpl/search.def $(TEMPLDIR)/common_translation.wml \
$(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml $(TEMPLDIR)/footer.wml \
$(GETTEXTDEP)
+
+search-convert: search.$(LANGUAGE).html
+ @c=`grep '^<meta http-equiv="Content-Type" content="text/html; charset=.*">' $? | sed -e 's/^<meta http-equiv="Content-Type" content="text\/html; charset=\(.*\)">/\1/'`; \
+ iconv -f $$c -t UTF-8 $? | sed -e 's/<meta http-equiv="Content-Type" content="text\/html; charset=.*">/<meta http-equiv="Content-Type" content="text\/html; charset=UTF-8">/' > $?.tmp && mv $?.tmp $?
Index: english/searchtmpl/search.data
===================================================================
RCS file: /cvs/webwml/webwml/english/searchtmpl/search.data,v
retrieving revision 1.30
diff -u -r1.30 search.data
--- english/searchtmpl/search.data 30 Dec 2002 03:26:24 -0000 1.30
+++ english/searchtmpl/search.data 19 Jan 2003 20:45:33 -0000
@@ -62,7 +62,6 @@
-->
<!--top-->
-$(CHARSET=UTF-8) $(CHARSET_WML=UTF-8)
#use wml::debian::common_translation HOME="http://www.debian.org"
$(title=<search>)
#use wml::debian::languages
Reply to: