Subject: Re: supporting-cast international
To: None <www@netbsd.org>
From: Jan Schaumann <jschauma@netmeister.org>
List: netbsd-docs
Date: 01/20/2002 13:09:55
--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
[sorry for x-post - thought it'd be of interest to netbsd-docs as well]
Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de> wrote:
> On Sat, 19 Jan 2002, Jan Schaumann wrote:
> > Also, I would like to propose a similar (though not yet detailed)
> > solution for /htdocs/index.html (Recent News and upcoming events) and
> > /htdocs/Security/index.html (Recent Advisories).
>
> Makes sense, too.
>
> Assuming it's ok that some english-language contents is acceptable on
> other-language pages...
Well, I think for the supporting cast, it certainly does. The
working-area simply lists phrases such as "htdocs" or "acorn32" (ie
words that wouldn't be translated in most cases anyway).
Wrt to index.html (NEWS and EVENTS), I think it's better to have english
but up-to-date rather than translated but hopelessly outdated headlines.
Here's what I've come up with to make "index.html" be semi-dynamic:
In /htdocs/, we keep NEWS and EVENTS in separate files rather than in
the index.html itself (conveniently named "NEWS" and "EVENTS"). The
attached Makefile and sed-script would then generate index.html when
running "make index" and at the same time update "<lang>/NEWS" and
"<lang>/EVENTS" and in turn generate the language-dependant index.html
file. The only change to the file index.html would be to add the
separating tags around the two sections[1].
This way, each <lang>-dir still has their own separate NEWS and EVENTS
files which they can translate and re-run "make index", but even if they
don't translate it, the page is still up-to-date (with links to the
events and news, even if on english pages).
What do you guys think - would that be overkill?
-Jan
[1] I used "<!-- NEWS::BEGIN -->" etc.
--
finger jschauma@netmeister.org
--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=Makefile
# $NetBSD: Makefile,v 1.2 1999/05/04 05:09:10 abs Exp $
# Nasty makefile to recurse into subdirs to ensure faq files are up to date
all: index
@for dir in `echo */Makefile | sed 's:/Makefile::g'` ; do \
echo "-> ${PDIR}$$dir";cd $$dir;${MAKE} PDIR=${PDIR}$$dir/; cd .. ;\
done
index: index.html de/index
index.html: NEWS EVENTS
sed -f index.sed $@ > $@.tmp
mv -f $@.tmp $@
de/index:
cd de; make index; cd ..;
--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="index.sed"
# $NetBSD: index.sed,v 1.0 2002/01/20 12:31:25 jschauma Exp$
#
# sed(1) script to replace the NEWS and EVENTS
/<!-- NEWS::START -->/bn
/<!-- EVENTS::START -->/be
:n
/<!-- NEWS::START -->/,/<!-- NEWS::END -->/ {
/<!-- NEWS::END -->/! {
$!{
N;
bn
}
}
i\
<!-- NEWS::START -->
r NEWS
a\
<!-- NEWS::END -->
d;
}
:e
/<!-- EVENTS::START -->/,/<!-- EVENTS::END -->/ {
/<!-- EVENTS::END -->/! {
$!{
N;
be
}
}
i\
<!-- EVENTS::START -->
r EVENTS
a\
<!-- EVENTS::END -->
d;
}
--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=Makefile
# $NetBSD: Makefile,v 1.2 1999/05/04 05:09:10 abs Exp $
# Nasty makefile to recurse into subdirs to ensure faq files are up to date
all: index
@for dir in `echo */Makefile | sed 's:/Makefile::g'` ; do \
echo "-> ${PDIR}$$dir";cd $$dir;${MAKE} PDIR=${PDIR}$$dir/; cd .. ;\
done
index: index.html
index.html: NEWS EVENTS ../NEWS ../EVENTS
sed -f ../index.sed $@ > $@.tmp
mv -f $@.tmp $@
NEWS: ../NEWS
sed -e 's/href="\(.*\)/href="..\/\1/' ../NEWS > $@
EVENTS: ../EVENTS
sed -e 's/href="\(.*\)/href="..\/\1/' ../EVENTS > $@
--T4sUOijqQbZv57TR--