* Joshua Slive wrote:

> If we wanted to get really fancy, we could have an xml file for each
> document that listed the available variants.  Then that xml file could
> be used both to generate a typemap for negotiation and to provide the
> translation links in each of the files.  This could be something to do
> in the future, but it is probably too big a hassel for right now, given
> the early stage of most of the translations.

hmm, I think, sitemap.xml is the right place for storing that info.

<page alternate="de ja ru">...</page>

or so. (but doesn't solve the problem...)

> So my suggestion is:
> 
> 1. See if we can develop a very short and simple bit of javascript to
> provide this link.  (Essentially just do s/\..*\.html$/\.en\.html/ or
> whatever.)
>
> 2. If not, we can add the extra tag.  It just seems silly to need to
> hard-code the filename into the file.
> 

I've attached a patch for including a JS and a corresponding CSS. This
should work in every browser with JS 1.0 support. A working example is
here:

<http://cvs.apache.org/~nd/manual/upgrading.html.de>

But... I don't like JS ;-)
I actually would prefer a SSI or better a post processing
solution (for example a perl script similiar to expand.pl).

and yes, you're right, hardcoding the filename should be the last
choice.

nd
-- 
If God intended people to be naked, they would be born that way.
  -- Oscar Wilde
Index: css/manual.css
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/style/css/manual.css,v
retrieving revision 1.9
diff -u -r1.9 manual.css
--- css/manual.css      22 Sep 2002 00:14:40 -0000      1.9
+++ css/manual.css      24 Sep 2002 15:05:59 -0000
@@ -577,6 +577,12 @@
     font-size: 13px;
 }
 
+div#original-doc {
+    padding-top: 0.2em;
+    float: right;
+    font-size: 13px;
+}
+
 /* content sections       */
 /* ====================== */
 div#preamble {
Index: xsl/common.xsl
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/common.xsl,v
retrieving revision 1.14
diff -u -r1.14 common.xsl
--- xsl/common.xsl      23 Sep 2002 03:40:12 -0000      1.14
+++ xsl/common.xsl      24 Sep 2002 15:06:04 -0000
@@ -113,6 +113,24 @@
       <a href="./"><img src="{$path}/images/left.gif" alt="&lt;-" 
title="&lt;-" /></a>
     </div>
 
+    <xsl:if test="not($messages/@lang = 'en')">
+      <xsl:text disable-output-escaping="yes">
+      &lt;script type="text/javascript"&gt;
+        var src  = String(self.document.URL);
+        if (src.substr(src.length-1,1) == '/') src += 'index.html';
+        var idx  = src.toLowerCase().lastIndexOf('.html');
+        if (idx &gt; 0) {
+          document.write(
+            '&lt;div id="original-doc"&gt;',
+            '&lt;a lang="en" hreflang="en" rel="alternate" href="',
+            src.substring(0, idx) + '.html.en',
+            '"&gt;English Version&lt;\/a&gt;&lt;\/div&gt;'
+          );
+        }
+      &lt;/script&gt;
+      </xsl:text>
+    </xsl:if>
+
     <div id="path">
 
           <a href="http://www.apache.org/";>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to