i18n

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

i18n

Marc.Benimeli
Hi all,

I'm trying to improve my app with internationalization.
So following the i18n sample i'm trying to change the label of a
"trigger" on the fly.

Here's an example:

....
<xforms:instance id="instance">
        <instance>
                <root>
                        <test name='MyLabel'>
                </root>
        </instance>
</xforms:instance>

<xforms:instance id="i18n" src="/initialisation/i18n-ressources"/> <!--
provide the file for i18n -->
....

I used to have :
<xforms:trigger appearance="xxforms:link">
        <xforms:label ref="@name"/>
</xforms:trigger>

Now I must have:
<xforms:trigger appearance="xxforms:link">
        <xforms:label ref="instance('i18n')/MyLabel"/>
</xforms:trigger>

Since MyLabel is not static I have to dynamic build the ref.
How can I do that ?

It seems that <xforms:label ref="concat('instance("i18n")/',@name)"/>
doesn't work.

Marc



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: i18n

Alessandro  Vernet
Administrator
Hi Marc,

So you are saying that you have in the resources something like this:

<resources>
    <MyLabel>...</MyLabel>
</resources>

With an element name equal to the value of the "name" attribute in
"instance"? If that is the case, then you can write something like:

<xforms:label ref="for $n in @name return
instance('i18n')/*[local-name() = $n]"/>

Alex

On 3/15/06, [hidden email] <[hidden email]> wrote:

> Hi all,
>
> I'm trying to improve my app with internationalization.
> So following the i18n sample i'm trying to change the label of a
> "trigger" on the fly.
>
> Here's an example:
>
> ....
> <xforms:instance id="instance">
>         <instance>
>                 <root>
>                         <test name='MyLabel'>
>                 </root>
>         </instance>
> </xforms:instance>
>
> <xforms:instance id="i18n" src="/initialisation/i18n-ressources"/> <!--
> provide the file for i18n -->
> ....
>
> I used to have :
> <xforms:trigger appearance="xxforms:link">
>         <xforms:label ref="@name"/>
> </xforms:trigger>
>
> Now I must have:
> <xforms:trigger appearance="xxforms:link">
>         <xforms:label ref="instance('i18n')/MyLabel"/>
> </xforms:trigger>
>
> Since MyLabel is not static I have to dynamic build the ref.
> How can I do that ?
>
> It seems that <xforms:label ref="concat('instance("i18n")/',@name)"/>
> doesn't work.
>
> Marc
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: i18n

Marc.Benimeli
In reply to this post by Marc.Benimeli

Hi Alex,

Thank you for the answear. It's exactly what I want.

What is this expression ? xslt, xpath ?

Marc


> Hi Marc,

> So you are saying that you have in the resources something like this:

> <resources>
>     <MyLabel name="">...</MyLabel>
> </resources>

> With an element name equal to the value of the "name" attribute in
"instance"? If that is the case, then you can write > something like:

> <xforms:label ref="for $n in @name return
> instance('i18n')/*[local-name() = $n]"/>




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: i18n

Alessandro  Vernet
Administrator
Hi Marc,

It is XPath 2.0. And you can try XPath expressions in the XPath sandbox at:

http://www.orbeon.com/ops/goto-example/xpath

Alex

On 3/17/06, [hidden email] <[hidden email]> wrote:

>
> Hi Alex,
>
> Thank you for the answear. It's exactly what I want.
>
> What is this expression ? xslt, xpath ?
>
> Marc
>
>
> > Hi Marc,
>
> > So you are saying that you have in the resources something like this:
>
> > <resources>
> >     <MyLabel name="">...</MyLabel>
> > </resources>
>
> > With an element name equal to the value of the "name" attribute in
> "instance"? If that is the case, then you can write > something like:
>
> > <xforms:label ref="for $n in @name return
> > instance('i18n')/*[local-name() = $n]"/>
>
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet