Added automatic detection of translations and set it up on the portuguese pages as a burn-in test

svn path=/trunk/; revision=1918
This commit is contained in:
jneves 2002-01-29 00:19:25 +00:00
parent 1129ce3f4c
commit 5df941d525
28 changed files with 111 additions and 244 deletions

View File

@ -83,14 +83,15 @@ $(DEPAGES): %.html: %.xhtml fsfe.xsl navigation.de.xsl
$(XSLTPROC) fsfe.xsl $$path $(XSLTOPTS) '$$fsfeurope='$$root '$$filebase='$$filebase '$$path='$$path > $$base.html-temp && (cat $$base.html-temp | perl -p -e '$$| = 1; (s/Date://, s/Author:/von/, s/\$$//g) if(/\$$''Date:/); s/mode: xml \*\*\*/mode: html \*\*\*/' > $$base.html) ; \
rm -f $$base.html-temp
$(PTPAGES): %.html: %.xhtml fsfe.xsl navigation.pt.xsl
$(PTPAGES): %.html: %.xhtml fsfe.xsl navigation.pt.xsl tools/translate.sh
@$(ECHO) "Building $@ ..."; \
path=$< ; \
base=`expr $$path : '\(.*\).xhtml'` ; \
filebase=`basename $$base` ; \
base=`expr $$path : '\(.*\).pt.xhtml'` ; \
filebase=`basename "$$base"` ; \
dir=`dirname $$path` ; \
root=`dirname $$path | perl -pe 'chop; s:([^/]+):..:g if($$_ ne ".")'` ; \
$(XSLTPROC) fsfe.xsl $$path $(XSLTOPTS) '$$fsfeurope='$$root '$$filebase='$$filebase '$$path='$$path > $$base.html-temp && (cat $$base.html-temp | perl -p -e '$$| = 1; (s/Date://, s/Author:/por/, s/\$$//g) if(/\$$''Date:/); s/mode: xml \*\*\*/mode: html \*\*\*/' > $$base.html) ; \
langlinks="`./tools/translate.sh $$base pt`" ; \
$(XSLTPROC) fsfe.xsl $$path $(XSLTOPTS) '$$fsfeurope='$$root '$$filebase='$$filebase.pt '$$path='$$path '$$langlinks='"$$langlinks" > $$base.pt.html-temp && (cat $$base.pt.html-temp | perl -p -e '$$| = 1; (s/Date://, s/Author:/por/, s/\$$//g) if(/\$$''Date:/); s/mode: xml \*\*\*/mode: html \*\*\*/' > $$base.pt.html) ; \
rm -f $$base.html-temp
$(ITPAGES): %.html: %.xhtml fsfe.xsl navigation.it.xsl

View File

@ -9,14 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="about.html">English</a> |
Português
]
</center>
<!-- Begin page content -->
<blockquote>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="background.de.html">Deutsch</a> |
<a href="background.html">English</a> |
<a href="background.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<h2>Origens</h2>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="boilerplate.de.html">Deutsch</a> |
<a href="boilerplate.en.html">English</a> |
<a href="boilerplate.fr.html">Français</a>|
Português
]
</center>
<!-- Begin page content -->
<p>This rocks</p>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="contact.de.html">Deutsch</a> |
<a href="contact.html">English</a> |
<a href="contact.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<h2>Listas de correio</h2>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="documents.de.html">Deutsch</a> |
<a href="documents.html">English</a> |
<a href="documents.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<div align="center">
<h2>Documents</h2>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="doi.de.html">Deutsch</a> |
<a href="doi.html">English</a> |
<a href="doi.fr.html">Français</a>|
Português
]
</center>
<!-- Begin page content -->
<div align="center">
<h2>Declaração de Intenções - Free Software Foundation Europa</h2>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="freesoftware.de.html">Deutsch</a> |
<a href="freesoftware.html">English</a> |
<a href="freesoftware.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<div align="center">
<h2>O que é o Software Livre?</h2>

View File

@ -9,17 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="gnuproject.de.html">Deutsch</a> |
<a href="gnuproject.html">English</a> |
<a href="gnuproject.fr.html">Français</a>|
Português
]
</center>
<!-- Begin page content -->
<!-- Begin page content -->
<div align="center">
<h2>O que é o Projecto GNU?</h2>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="preamble.de.html">Deutsch</a> |
<a href="preamble.html">English</a> |
<a href="preamble.fr.html">Français</a>|
Português
]
</center>
<!-- Begin page content -->
<div align="center">
<h2>Preâmbulo da Free Software Foundation Europa</h2>

View File

@ -9,15 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="whatwedo.de.html">Deutsch</a> |
<a href="whatwedo.html">English</a> |
Português
]
</center>
<!-- Begin page content -->
<div align="center">
<h2>O que é que nós fazemos ?</h2>

View File

@ -10,18 +10,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="whyfs.de.html">Deutsch</a> |
<a href="whyfs.en.html">English</a> |
<a href="whyfs.es.html">Español</a> |
<a href="whyfs.fr.html">Français</a> |
<a href="whyfs.it.html">Italiano</a> |
Português
]
</center>
<!-- Begin page content -->
<center><h2>Nós falamos de Software Livre</h2></center>

View File

@ -9,22 +9,13 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="whyweexist.de.html">Deutsch</a> |
<a href="whyweexist.html">English</a> |
Português
]
</center>
<!-- Begin page content -->
<div align="center">
<h2>Porque é que existimos?</h2>
</div>
<p> A Free Software Foundation Europe (FSF Europa) foi fundada em 2001 como organização irmã da Free Software Foundation (FSF) dos EUA para tratar de todos os assuntos relacionados com <a href="freesoftware.pt.html">Software Livre</a> na Europa.</p>
<p>Város factores tornaram este passo necessário.</p>
<p>Vários factores tornaram este passo necessário.</p>
<ul>

View File

@ -18,6 +18,7 @@
<xsl:param name="gnu">http://www.gnu.org</xsl:param>
<xsl:param name="filebase">nofile.html</xsl:param>
<xsl:param name="path">nofile.html</xsl:param>
<xsl:param name="langlinks">[ English ]</xsl:param>
<xsl:template match="/">
<xsl:copy>

View File

@ -9,15 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<a href="index.de.html">Deutsch</a> |
<a href="index.html">English</a> |
<a href="index.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<h2>GNU Business Network (Rede Empresarial GNU)</h2>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="help.de.html">Deutsch</a> |
<a href="help.html">English</a> |
<a href="help.it.html">Italiano</a> |
Português
]
</center>
<!-- Begin page content -->
<h2>Como pode ajudar-nos?</h2>

View File

@ -9,18 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="index.de.html">Deutsch</a> |
<a href="index.html">English</a> |
<a href="index.es.html">Español</a> |
<a href="index.fr.html">Français</a> |
<a href="index.it.html">Italiano</a> |
Português
]
</center>
<!-- Begin page content -->
<center>
<h1>Free Software Foundation Europa</h1>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="law.de.html">Deutsch</a> |
<a href="law.en.html">English</a> |
<a href="law.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<div align="center">
<h2>Proteger o Software Livre na Europa</h2>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="index.de.html">Deutsch</a> |
<a href="index.html">English</a> |
<a href="index.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<h2>Sobre as listas de correio</h2>
<p>

View File

@ -48,6 +48,9 @@
<tr>
<td width="99%" valign="top">
<div class="content">
<center>
<xsl:value-of select="$langlinks" disable-output-escaping="yes"/>
</center>
<xsl:apply-templates select="@*|node()"/>
</div>
</td>

View File

@ -7,17 +7,6 @@
</head>
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="article2001-08-23-01.de.html">Deutsch</a> |
<a href="article2001-08-23-01.en.html">English</a> |
<a href="article2001-08-23-01.es.html">Español</a> |
<a href="article2001-08-23-01.fr.html">Français</a> |
<a href="article2001-08-23-01.it.html">Italian</a> |
Português
]
</center>
<p />
<blockquote>
<center><h2>Peritos em Informática Livre</h2></center>

View File

@ -8,16 +8,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="article2001-10-20-01.de.html">Deutsch</a> |
<a href="article2001-10-20-01.en.html">English</a> |
<a href="article2001-10-20-01.es.html">Español</a> |
<a href="article2001-10-20-01.fr.html">Français</a> |
Português
]
</center>
<p />
<blockquote>
<center><h2>SourceForge muda de rumo</h2></center>

View File

@ -8,14 +8,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="article2001-12-17-01.en.html">English</a> |
Português
]
</center>
<!-- Begin page content -->
<center>

View File

@ -8,16 +8,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="article2002-01-18-01.en.html">English</a> |
<a href="article2002-01-18-01.es.html">Español</a> |
<a href="article2002-01-18-01.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<center>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="news.de.html">Deutsch</a> |
<a href="news.html">English</a> |
<a href="news.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<div align="center">

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="index.de.html">Deutsch</a> |
<a href="index.html">English</a> |
<a href="index.fr.html">Français</a> |
Português
]
</center>
<!-- Begin page content -->
<h2>Relações com a Imprensa</h2>

View File

@ -9,16 +9,6 @@
<body>
<div> <!-- The header will be inserted here -->
<center>
[
<!-- Please update as needed and keep it in alphabetical order -->
<a href="siae.en.html">English</a> |
<a href="siae.fr.html">Français</a>|
<a href="siae.it.html">Italiano</a> |
Português
]
</center>
<!-- Begin page content -->
<center>

101
tools/translate.sh Normal file
View File

@ -0,0 +1,101 @@
#! /bin/sh
BASE="$1"
LANGUAGE="$2"
LANGS=""
RESULT=""
# Find what translations are available.
for j in $BASE.??.xhtml; do
LANGS="`expr $j : $BASE.\\\\\(.*\\\\\).xhtml` $LANGS"
done
# Special case while we don't change all those *.xhtml to *.en.xhtml
if [ -f $BASE.xhtml ]; then
LANGS="EN $LANGS"
fi
# Create the string to be included in the webpage.
BASENAME=`basename $BASE`
SEPARATOR="[ "
if [ "`echo $LANGS | grep de`" != "" ]; then
RESULT="$RESULT""$SEPARATOR"
if [ "$LANGUAGE" != "de" ]; then
RESULT="$RESULT""<a href=\"$BASENAME.de.html\">"
fi
RESULT="$RESULT""Deutsch"
if [ "$LANGUAGE" != "de" ]; then
RESULT="$RESULT""</a>"
fi
SEPARATOR=" | "
fi
if [ "`echo $LANGS | grep en`" != "" ]; then
RESULT="$RESULT""$SEPARATOR"
if [ "$LANGUAGE" != "en" ]; then
RESULT="$RESULT""<a href=\"$BASENAME.en.html\">"
fi
RESULT="$RESULT""English"
if [ "$LANGUAGE" != "en" ]; then
RESULT="$RESULT""</a>"
fi
SEPARATOR=" | "
fi
# Again, the special case
if [ "`echo $LANGS | grep EN`" != "" ]; then
RESULT="$RESULT""$SEPARATOR"
if [ "$LANGUAGE" != "en" ]; then
RESULT="$RESULT""<a href=\"$BASENAME.html\">"
fi
RESULT="$RESULT""English"
if [ "$LANGUAGE" != "en" ]; then
RESULT="$RESULT""</a>"
fi
SEPARATOR=" | "
fi
if [ "`echo $LANGS | grep es`" != "" ]; then
RESULT="$RESULT""$SEPARATOR"
if [ "$LANGUAGE" != "es" ]; then
RESULT="$RESULT""<a href=\"$BASENAME.es.html\">"
fi
RESULT="$RESULT""Espa&ntilde;ol"
if [ "$LANGUAGE" != "es" ]; then
RESULT="$RESULT""</a>"
fi
SEPARATOR=" | "
fi
if [ "`echo $LANGS | grep fr`" != "" ]; then
RESULT="$RESULT""$SEPARATOR"
if [ "$LANGUAGE" != "fr" ]; then
RESULT="$RESULT""<a href=\"$BASENAME.fr.html\">"
fi
RESULT="$RESULT""Fran&ccedil;ais"
if [ "$LANGUAGE" != "fr" ]; then
RESULT="$RESULT""</a>"
fi
SEPARATOR=" | "
fi
if [ "`echo $LANGS | grep it`" != "" ]; then
RESULT="$RESULT""$SEPARATOR"
if [ "$LANGUAGE" != "it" ]; then
RESULT="$RESULT""<a href=\"$BASENAME.it.html\">"
fi
RESULT="$RESULT""Italiano"
if [ "$LANGUAGE" != "it" ]; then
RESULT="$RESULT""</a>"
fi
SEPARATOR=" | "
fi
if [ "`echo $LANGS | grep pt`" != "" ]; then
RESULT="$RESULT""$SEPARATOR"
if [ "$LANGUAGE" != "pt" ]; then
RESULT="$RESULT""<a href=\"$BASENAME.pt.html\">"
fi
RESULT="$RESULT""Portugu&ecirc;s"
if [ "$LANGUAGE" != "pt" ]; then
RESULT="$RESULT""</a>"
fi
SEPARATOR=" | "
fi
RESULT="$RESULT ]"
# Output the string.
echo "$RESULT"