Add "Synchronization Status" feature in Japanese web pages.
1. Add .sgml -> .revinc rule in web.mk. This tells how to make SGML include file which contains revision information. 2. Add ja/revcheck script. This script makes revision information from English SGML file and localized one. 3. Add *.revinc files into GENDOCS in localized Makefile. This will generate *.revinc files from each *.sgml files. 4. Add %rev.diff entity into localized includes.sgml. 5. Add statement to include *.revinc for each *.sgml files. (this will be followed separately.) Reviewed and not objected by: Doc Team
This commit is contained in:
parent
965d022d71
commit
549131b114
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=6255
5 changed files with 109 additions and 7 deletions
17
en/web.mk
17
en/web.mk
|
@ -1,5 +1,5 @@
|
|||
# bsd.web.mk
|
||||
# $FreeBSD: www/en/web.mk,v 1.25 1999/11/28 22:32:38 kuriyama Exp $
|
||||
# $FreeBSD: www/en/web.mk,v 1.26 1999/11/29 15:11:56 kuriyama Exp $
|
||||
|
||||
#
|
||||
# Build and install a web site.
|
||||
|
@ -51,6 +51,19 @@ PORTSBASE?= /usr
|
|||
##################################################################
|
||||
# Transformation rules
|
||||
|
||||
###
|
||||
# file.sgml --> file.revinc
|
||||
#
|
||||
# Generate temporary file for translation revision checking
|
||||
.SUFFIXES: .sgml .revinc
|
||||
GENDOCS+= ${REVFILES}
|
||||
.sgml.revinc:
|
||||
if [ -f ${BUILDTOP}/en/${DIR_IN_LOCAL}/${.IMPSRC} ]; then \
|
||||
${BUILDTOP}/ja/revcheck ${BUILDTOP} ${DIR_IN_LOCAL} ${.IMPSRC} > ${.TARGET}; \
|
||||
else \
|
||||
touch ${.TARGET}; \
|
||||
fi
|
||||
|
||||
###
|
||||
# file.sgml --> file.html
|
||||
#
|
||||
|
@ -58,7 +71,7 @@ PORTSBASE?= /usr
|
|||
# references are expanded. file.html is added to the list of
|
||||
# things to install.
|
||||
|
||||
.SUFFIXES: .sgml .html
|
||||
.SUFFIXES: .html
|
||||
SGMLNORM= sgmlnorm
|
||||
PREFIX?= /usr/local
|
||||
CATALOG?= ${PREFIX}/share/sgml/html/catalog
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $FreeBSD: www/ja/Makefile,v 1.35 1999/09/07 15:15:44 kuriyama Exp $
|
||||
# $FreeBSD: www/ja/Makefile,v 1.36 1999/11/07 11:33:12 kuriyama Exp $
|
||||
# The FreeBSD Japanese Documentation Project
|
||||
# Original revision: 1.50
|
||||
|
||||
|
@ -22,7 +22,7 @@ DOCS+= send-pr.sgml
|
|||
DOCS+= support.sgml
|
||||
DOCS+= where.sgml
|
||||
DOCS+= y2kbug.sgml
|
||||
|
||||
|
||||
# Japanese-only file
|
||||
DOCS+= jabout.sgml
|
||||
|
||||
|
@ -67,5 +67,10 @@ SGMLOPTS= -links -hdr ${.CURDIR}/doc.hdr -ftr ${.CURDIR}/doc.ftr -e EUC-JP
|
|||
|
||||
WEBDIR= data/ja
|
||||
|
||||
### Revision checking
|
||||
REVFILES= ${DOCS:M*.sgml:S/.sgml$/.revinc/g}
|
||||
BUILDTOP= ..
|
||||
DIR_IN_LOCAL= .
|
||||
|
||||
.include "../web.mk"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- $FreeBSD: www/ja/includes.sgml,v 1.17 1999/10/02 01:19:33 kuriyama Exp $ -->
|
||||
<!-- $FreeBSD: www/ja/includes.sgml,v 1.18 1999/11/28 14:29:35 kuriyama Exp $ -->
|
||||
<!-- The FreeBSD Japanese Documentation Project -->
|
||||
<!-- Original revision: 1.30 -->
|
||||
<!--
|
||||
|
@ -33,12 +33,26 @@
|
|||
<!ENTITY home '<a href="&base/"><img src="&base/../gifs/home.gif"
|
||||
alt="FreeBSD Home Page" border="0" align="right" width="101" height="33"></a>'>
|
||||
|
||||
<!-- Revision checking -->
|
||||
<!ENTITY % rev.diff "IGNORE">
|
||||
<![ %rev.diff; [
|
||||
<!ENTITY cvsweb 'http://www.jp.FreeBSD.org/cgi/cvsweb.cgi/'>
|
||||
<!ENTITY rev.msg '
|
||||
<p>
|
||||
(訳注: 最新の <a href="&buildtop;/&reldir;/&basename;.html">原文</a> とは
|
||||
<a href="&cvsweb;www/en/&reldir;/&basename;.sgml.diff?r1=&rev.base;&r2=&rev.latest;">
|
||||
ずれ</a> があります.)
|
||||
</p>'>
|
||||
]]>
|
||||
<!ENTITY rev.msg ''>
|
||||
|
||||
<!-- Standard headers and footers -->
|
||||
|
||||
<!ENTITY header '<head><META HTTP-EQUIV="Content-Type"
|
||||
CONTENT="text/html; charset=EUC-JP"><title>&title;</title></head><body
|
||||
text="#000000" bgcolor="#FFFFFF" alink="#FFCC33"><img
|
||||
src="&base/../gifs/bar.gif" alt="¥á¥Ë¥å¡¼" width="565" height="33" border="0" usemap="#bar">
|
||||
&rev.msg;
|
||||
<h1 align="left"><font color="#660000">&title;</font></h1><br clear="all">
|
||||
|
||||
<map name="bar">
|
||||
|
|
57
ja/revcheck
Executable file
57
ja/revcheck
Executable file
|
@ -0,0 +1,57 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# The FreeBSD Japanese Documentation Project
|
||||
#
|
||||
# usage: revcheck <build topdir> <relative to localtop> <SGML filename>
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
my $buildtop = $ARGV[0];
|
||||
my $reldir = $ARGV[1];
|
||||
my $name_ja = $ARGV[2];
|
||||
my $dir_en = $buildtop . "/en/" . $reldir;
|
||||
my $name_en = $dir_en . "/" . $name_ja;
|
||||
my $rev_en;
|
||||
my $rev_ja;
|
||||
my $basename = $name_ja;
|
||||
|
||||
$basename =~ s/\.sgml//;
|
||||
|
||||
### File exist?
|
||||
die "Cannot read local file: $!\n"
|
||||
unless -r $name_ja;
|
||||
die "Cannot read English file: $!\n"
|
||||
unless -r $name_en;
|
||||
|
||||
### Open English file.
|
||||
open EN, $name_en or die "Cannot open English file: $!\n";
|
||||
while (<EN>) {
|
||||
if (/\$FreeBSD: .* (.*) .* .* .* .* \$/) {
|
||||
$rev_en = $1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close EN;
|
||||
|
||||
### Open Localized file.
|
||||
open JA, $name_ja or die "Cannot open localized file: $!\n";
|
||||
while (<JA>) {
|
||||
if (/Original [Rr]evision:[ \t]*([0-9.]+)/) {
|
||||
$rev_ja = $1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close JA;
|
||||
|
||||
#print ".if \${REV_NAME} == $name_ja\n";
|
||||
# print ".if \${.IMPSRC} == $name_ja\n";
|
||||
# print "LATEST_EN_REV= $rev_en\n";
|
||||
# print "CURRENT_BASE_REV= $rev_ja\n";
|
||||
# print ".endif\n";
|
||||
print "<!ENTITY buildtop '$buildtop'>\n";
|
||||
print "<!ENTITY reldir '$reldir'>\n";
|
||||
print "<!ENTITY dir.en '$dir_en'>\n";
|
||||
print "<!ENTITY basename '$basename'>\n";
|
||||
print "<!ENTITY rev.base '$rev_ja'>\n";
|
||||
print "<!ENTITY rev.latest '$rev_en'>\n";
|
||||
printf "<!ENTITY %% rev.diff '%s'>\n", ($rev_ja eq $rev_en) ? "IGNORE" : "INCLUDE";
|
|
@ -1,5 +1,5 @@
|
|||
# bsd.web.mk
|
||||
# $FreeBSD: www/en/web.mk,v 1.25 1999/11/28 22:32:38 kuriyama Exp $
|
||||
# $FreeBSD: www/en/web.mk,v 1.26 1999/11/29 15:11:56 kuriyama Exp $
|
||||
|
||||
#
|
||||
# Build and install a web site.
|
||||
|
@ -51,6 +51,19 @@ PORTSBASE?= /usr
|
|||
##################################################################
|
||||
# Transformation rules
|
||||
|
||||
###
|
||||
# file.sgml --> file.revinc
|
||||
#
|
||||
# Generate temporary file for translation revision checking
|
||||
.SUFFIXES: .sgml .revinc
|
||||
GENDOCS+= ${REVFILES}
|
||||
.sgml.revinc:
|
||||
if [ -f ${BUILDTOP}/en/${DIR_IN_LOCAL}/${.IMPSRC} ]; then \
|
||||
${BUILDTOP}/ja/revcheck ${BUILDTOP} ${DIR_IN_LOCAL} ${.IMPSRC} > ${.TARGET}; \
|
||||
else \
|
||||
touch ${.TARGET}; \
|
||||
fi
|
||||
|
||||
###
|
||||
# file.sgml --> file.html
|
||||
#
|
||||
|
@ -58,7 +71,7 @@ PORTSBASE?= /usr
|
|||
# references are expanded. file.html is added to the list of
|
||||
# things to install.
|
||||
|
||||
.SUFFIXES: .sgml .html
|
||||
.SUFFIXES: .html
|
||||
SGMLNORM= sgmlnorm
|
||||
PREFIX?= /usr/local
|
||||
CATALOG?= ${PREFIX}/share/sgml/html/catalog
|
||||
|
|
Loading…
Reference in a new issue