You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Thomas Hartwig <t....@crapoud.com> on 2004/07/09 21:50:56 UTC

switching language

Hello folks,

a short questions. How can I procide an easy way to switch an other 
language version for a special document?

I have following links in page2xhtml.xsl. These links link to the home 
page in the specified languages of course. But how can I make this 
dynamic to the counterpart page in the other language?

<a href="/{$root}/index_de.html"><img hspace="5" alt="" 
src="{$root}/images/germany-icon.gif" border="0"/></a>
<a href="/{$root}/index_en.html"><img hspace="5" alt="" 
src="{$root}/images/great-britain-united-states.gif" border="0"/></a>

Thanks for any advice
Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: switching language

Posted by Cristiano Fugazza <ca...@kount0.com>.
Hello Thorsten,

    pleased to read from you ;-).
    More about the language switch: the option inside the xsl:otherwise 
clause should be the default language as you can access a page without 
any "_??" suffix..

Cheers,

Cristiano


Thorsten Scherler wrote:

> Hello Cristiano,
>
> back in Italy ;-).
>
> Cristiano Fugazza wrote:
>
>> I do this with a xsl:choose construct inside page2xhtml.xsl:
>>
>>                  <xsl:choose>
>>                      <xsl:when test="contains( $url, '_en' )">
>>                          <a href="...">versione italiana</a>
>
>
> <br/>                          <a href="...">deutsche version</a>
>
>>                      </xsl:when>
>
>
>                     <xsl:when test="contains( $url, '_de' )">
>                         <a href="...">versione italiana</a>
> <br/>                          <a href="...">english version</a>
>
>>                      </xsl:when>
>
>
>
>                      <xsl:otherwise>
>
>>                          <a href="...">english version</a>
>
>
> <br/>                          <a href="...">deutsche version</a>
>
>>                      </xsl:otherwise>
>>                  </xsl:choose>
>>
> That works with 3, and can be extended to n.
>
> King regards
> thorsten
>
>> Cristiano
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: switching language

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
Hello Cristiano,

back in Italy ;-).

Cristiano Fugazza wrote:

> I do this with a xsl:choose construct inside page2xhtml.xsl:
>
>                  <xsl:choose>
>                      <xsl:when test="contains( $url, '_en' )">
>                          <a href="...">versione italiana</a>

<br/>                          
<a href="...">deutsche version</a>

>                      </xsl:when>

                     <xsl:when test="contains( $url, '_de' )">
                         <a href="...">versione italiana</a>
<br/>                          
<a href="...">english version</a>

>                      </xsl:when>


                      <xsl:otherwise>

>                          <a href="...">english version</a>

<br/>                          
<a href="...">deutsche version</a>

>                      </xsl:otherwise>
>                  </xsl:choose>
>
That works with 3, and can be extended to n.

King regards
thorsten

> Cristiano


-- 
Thorsten Scherler

Departamento de Desarrollo de Proyectos
Sociedad Andaluza para el Desarrollo de la Sociedad de la Información S.A.U.
Avda. de la Arboleda s/n
41940 - Tomares,  (Sevilla)
Tlfn: (+34) 955 062 627
e-mail: thorsten.scherler.ext@juntadeandalucia.es

Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de "Sociedad
Andaluza para el Desarrollo de la Sociedad de la Información, S.A.U.". Si no
es Ud. el destinatario del mensaje le ruego lo destruya sin hacer copia
digital o física, comunicando a Sociedad Andaluza para el Desarrollo de la
Sociedad de la Información S.A.U. vía e-mail o fax la recepción del presente
mensaje. Toda declaración de voluntad contenida deberá ser tenida por no
producida. Gracias.
____________________________________________________________________________
___________________

The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of "Sociedad Andaluza para
el Desarrollo de la Sociedad de la Información, S.A.U.". If you are not the
formal receiver of this message please destroy it without making any digital
or physical copy and inform "Sociedad Andaluza para el Desarrollo de la
Sociedad de la Información S.A.U." , by e-mail or fax, of the reception of
the present message. Any whatsoever involuntary declaration contained
herewith must be taken as having no legal effect. Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: switching language

Posted by Cristiano Fugazza <ca...@kount0.com>.
I do this with a xsl:choose construct inside page2xhtml.xsl:

                  <xsl:choose>
                      <xsl:when test="contains( $url, '_en' )">
                          <a href="...">versione italiana</a>
                      </xsl:when>
                      <xsl:otherwise>
                          <a href="...">english version</a>
                      </xsl:otherwise>
                  </xsl:choose>

With three different languages you should do something different.

Cheers,

Cristiano

>>
>> Hello Thomas,
>> href="{$root}{$document-id}_de.html"
>> href="{$root}{$document-id}_en.html"
>> should do the trick.
>> Btw. is there a variable for the language of {$document-de} to only 
>> display links to other languages (to _de if currently in _en)?
>> Hubertus
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: switching language

Posted by Thomas Hartwig <t....@crapoud.com>.
Hello Hubertus,

thanks that worked :-). I'll post a solution to your question if I'm at 
this point. ;-)

Thomas

Hubertus Groepper wrote:
> 
> Am 09.07.2004 um 21:50 schrieb Thomas Hartwig:
> 
>> Hello folks,
>>
>> a short questions. How can I procide an easy way to switch an other 
>> language version for a special document?
>>
>> I have following links in page2xhtml.xsl. These links link to the home 
>> page in the specified languages of course. But how can I make this 
>> dynamic to the counterpart page in the other language?
>>
>> <a href="/{$root}/index_de.html"><img hspace="5" alt="" 
>> src="{$root}/images/germany-icon.gif" border="0"/></a>
>> <a href="/{$root}/index_en.html"><img hspace="5" alt="" 
>> src="{$root}/images/great-britain-united-states.gif" border="0"/></a>
>>
>> Thanks for any advice
>> Thomas
> 
> 
> Hello Thomas,
> href="{$root}{$document-id}_de.html"
> href="{$root}{$document-id}_en.html"
> should do the trick.
> Btw. is there a variable for the language of {$document-de} to only 
> display links to other languages (to _de if currently in _en)?
> Hubertus
> 
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: lenya-user-help@cocoon.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: switching language

Posted by Hubertus Groepper <hu...@groepper.com>.
Am 09.07.2004 um 21:50 schrieb Thomas Hartwig:

> Hello folks,
>
> a short questions. How can I procide an easy way to switch an other 
> language version for a special document?
>
> I have following links in page2xhtml.xsl. These links link to the home 
> page in the specified languages of course. But how can I make this 
> dynamic to the counterpart page in the other language?
>
> <a href="/{$root}/index_de.html"><img hspace="5" alt="" 
> src="{$root}/images/germany-icon.gif" border="0"/></a>
> <a href="/{$root}/index_en.html"><img hspace="5" alt="" 
> src="{$root}/images/great-britain-united-states.gif" border="0"/></a>
>
> Thanks for any advice
> Thomas

Hello Thomas,
href="{$root}{$document-id}_de.html"
href="{$root}{$document-id}_en.html"
should do the trick.
Btw. is there a variable for the language of {$document-de} to only 
display links to other languages (to _de if currently in _en)?
Hubertus

>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: lenya-user-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org