xsl-list
[Top] [All Lists]

RE: Multilanguage help

2006-02-15 01:46:15
Thanks a lot Antonio, 
I'm now testing on your suggestion of yesterday (to search at archives) and
I found a solution like yours.

Once again thank you all.
Impressive list!



-----Mensaje original-----
De: António Mota [mailto:amsmota(_at_)gmail(_dot_)com] 
Enviado el: miércoles, 15 de febrero de 2006 9:37
Para: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Asunto: Re: [xsl] Multilanguage help

Extremely easy to do with the document() function. I don't have my XML
tools here but from the top of my head it's something like this:

Supose you have a XML like this

xml_pt.xml

<translations>
    <word id='Descripcion'>Descrição</word>
   (...)
</translations>

then, in your xsl you should have something that tell what the
language to translate to, a param for instance. Supose you pass 'pt'
to it.

<xsl:param name="lang"/>
<xsl:variable name="filename" select="concat('/filepath/xml_',$lang,'.xml')
/>

and later on instead of

<td class="inici">Descripcion       </td>

you'll have

<td class="inici">
   <xsl:value-of
select="document($filename)/translations/word[(_at_)id='Descripcion']
 </td>

and that's it.

Of course you can pass the filename alltogether in the param and avoid
that concat().

This is not tested at all.

Hope it helps.

On 15/02/06, Guillem Rico <grico(_at_)iasist(_dot_)com> wrote:
Ok,

I have a data XML linked to a XSL file.
This XSL file outputs the contents of that XML file (no problem).

The real problem I have is I want to output the table titles of my xsl
file
in several languages (spanish, catalan, portuguese, english), and I don't
want to change from 1 only XSL file to four.


A simple example like this:
(My actual and only XSL):

         <td class="inici">Descripcion       </td>
         <td class="inici">N                        </td>


In catalan should output:

        Descripció  | N

In english:
        Description      | N
.
.


I hope there is a simple way to do it, and I'm thinking the best option,
so
I consider you could help me (If I've explained it clearly).

Thanks


-----Mensaje original-----
De: Vasu Chakkera [mailto:vasucv(_at_)hotmail(_dot_)com]
Enviado el: miércoles, 15 de febrero de 2006 0:25
Para: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Asunto: RE: [xsl] Multilanguage help

tell us exactly what you want to do..there could be other ways of doing
the
same.
give us an example of what you want.and someone would be able to suggest
you

ways.


From: "Guillem Rico" <grico(_at_)iasist(_dot_)com>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: [xsl] Multilanguage help
Date: Tue, 14 Feb 2006 18:16:14 +0100


Hi, I'm trying  to do a Multilanguage XSL, but I don't know how...

I have a XML file (with data), and the XML is Ok translated, So I only
need
to transalte Fields of tables placed into XSL...

I think I could store the translations maybe in another XML, but I don't
know how to call the another XSL into an XSL (if I could), or wich is the
best way to do it

I don't know what to do...any ideas??

I'm a XSL begginner, please if you could send some examples

Thanks





.

.

.

.

<table border="0" cellpadding="0" cellspacing="0"
width="90%"align="center">


<xsl:variable name="serv" select="/PICA/DATA/REGISTRE/Servicio" />

<tr><td align='right'><ahref="../datos/fr.html?serv={$serv}?t=t">Todos
</a>

<a href="../datos/fr.html?serv={$serv}?t=2">Quirúrgicos  </a>

<a href="../datos/fr.html?serv={$serv}?t=1">Médicos</a></td></tr>

</table>



<table border="0" cellpadding="0" cellspacing="0"
width="90%"align="center">

      <tr>

                        <td class="inici"> Grd
</td>

                        <td class="inici">CDM
</td>

                        <td class="inici" width="3%">T     </td>

                        <td class="inici">Descripcion       </td>

                        <td class="inici">N
</td>

                        <td class="inici">PNh
</td>

                        <td class="inici">PNstd
</td>

                        <td class="inici">Nobs-Nesp              </td>

                        <td class="inici">Peso
</td>       </tr>







      <xsl:for-each select="PICA/DATA/REGISTRE">

      <xsl:sort data-type="number" select="N" order="descending" />



      <tr>

      <xsl:choose>

      <xsl:when test="position() &lt; '20'">

      <xsl:choose>

.

.

.

.







--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


_________________________________________________________________
Are you using the latest version of MSN Messenger? Download MSN Messenger
7.5 today! http://messenger.msn.co.uk


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>