language-aware date on output

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

language-aware date on output

koenvdk
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:

<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>
<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>
<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>
<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>
   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.

I tried lang(), but it expects an argument
I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?


Sincerely



Koen Vanderkimpen

Connect: Twitter

[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -
www.smals.be
Tel. +32 2 787 4670
Fonsnylaan 20, lokaal 4-101
1060 Brussel








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.





--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: language-aware date on output

Erik Bruchez
Administrator
Koen,

Good point. What we had in mind at some point was to introduce new properties taking the language into consideration.

However, since then we have added the xxforms:lang() function. And I think that it's better to simply use that function in the existing properties. So, I have done just this, and as you have noticed, there is an issue with an undeclared prefix. So I have also fixed that and committed a change which makes the formats properties language aware.


In order for this to work, there must be an xml:lang attribute in the form. You can place that attribute on the root element of the document for example.

-Erik

On Mon, Jul 30, 2012 at 4:45 AM, <[hidden email]> wrote:
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:

<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>
<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>
<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>
<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>
   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.

I tried lang(), but it expects an argument
I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?


Sincerely



Koen Vanderkimpen

Connect: Twitter

[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -
www.smals.be
Tel. <a href="tel:%2B32%202%20787%204670" value="+3227874670" target="_blank">+32 2 787 4670
Fonsnylaan 20, lokaal 4-101
1060 Brussel








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.






--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: language-aware date on output

koenvdk
Hi Eric,

So will the dates be language-aware in the next release?


In the mean time, I still have to use 3.9, so what's a simple syntax to make the dates purely numerical?

Thx,



Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter





From:        Erik Bruchez <[hidden email]>
To:        [hidden email]
Date:        31/07/2012 21:32
Subject:        [ops-users] Re: language-aware date on output
Sent by:        [hidden email]




Koen,

Good point. What we had in mind at some point was to introduce new properties taking the language into consideration.

However, since then we have added the xxforms:lang() function. And I think that it's better to simply use that function in the existing properties. So, I have done just this, and as you have noticed, there is an issue with an undeclared prefix. So I have also fixed that and committed a change which makes the formats properties language aware.

https://github.com/orbeon/orbeon-forms/commit/120950543143db2b9427c60e901ec5ac7eb98542

In order for this to work, there must be an xml:lang attribute in the form. You can place that attribute on the root element of the document for example.

-Erik

On Mon, Jul 30, 2012 at 4:45 AM, <Koen.Vanderkimpen@...> wrote:
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:


<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.


I tried lang(), but it expects an argument

I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?



Sincerely




Koen Vanderkimpen

Connect:

[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -
www.smals.be
Tel.
<a href=tel:%2B32%202%20787%204670 target=_blank>+32 2 787 4670
Fonsnylaan 20, lokaal 4-101

1060 Brussel







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.





--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: language-aware date on output

Erik Bruchez
Administrator
Yes, this will be the next release.

Check some examples of date formatting here:


-Erik

On Tue, Aug 21, 2012 at 5:24 AM, <[hidden email]> wrote:
Hi Eric,

So will the dates be language-aware in the next release?


In the mean time, I still have to use 3.9, so what's a simple syntax to make the dates purely numerical?

Thx,



Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter





From:        Erik Bruchez <[hidden email]>
To:        [hidden email]
Date:        31/07/2012 21:32
Subject:        [ops-users] Re: language-aware date on output
Sent by:        [hidden email]




Koen,

Good point. What we had in mind at some point was to introduce new properties taking the language into consideration.

However, since then we have added the xxforms:lang() function. And I think that it's better to simply use that function in the existing properties. So, I have done just this, and as you have noticed, there is an issue with an undeclared prefix. So I have also fixed that and committed a change which makes the formats properties language aware.

https://github.com/orbeon/orbeon-forms/commit/120950543143db2b9427c60e901ec5ac7eb98542

In order for this to work, there must be an xml:lang attribute in the form. You can place that attribute on the root element of the document for example.

-Erik

On Mon, Jul 30, 2012 at 4:45 AM, <[hidden email]> wrote:
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:


<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.


I tried lang(), but it expects an argument

I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?



Sincerely




Koen Vanderkimpen

Connect:


[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -
www.smals.be
Tel.
<a href="tel:%2B32%202%20787%204670" target="_blank">+32 2 787 4670
Fonsnylaan 20, lokaal 4-101

1060 Brussel







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.






--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: language-aware date on output

koenvdk
In reply to this post by Erik Bruchez
Hi,

I recently saw a reason to get back on this.

xxforms:lang() does not seem to work in xpath expressions in forms made using form builder. Is this normal?

Bye,


Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter

"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        Koen Vanderkimpen/Smals
To:        [hidden email]
Date:        21/08/2012 14:24
Subject:        Re: [ops-users] Re: language-aware date on output



Hi Eric,

So will the dates be language-aware in the next release?


In the mean time, I still have to use 3.9, so what's a simple syntax to make the dates purely numerical?

Thx,



Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter






From:        Erik Bruchez <[hidden email]>
To:        [hidden email]
Date:        31/07/2012 21:32
Subject:        [ops-users] Re: language-aware date on output
Sent by:        [hidden email]




Koen,

Good point. What we had in mind at some point was to introduce new properties taking the language into consideration.

However, since then we have added the xxforms:lang() function. And I think that it's better to simply use that function in the existing properties. So, I have done just this, and as you have noticed, there is an issue with an undeclared prefix. So I have also fixed that and committed a change which makes the formats properties language aware.

https://github.com/orbeon/orbeon-forms/commit/120950543143db2b9427c60e901ec5ac7eb98542

In order for this to work, there must be an xml:lang attribute in the form. You can place that attribute on the root element of the document for example.

-Erik

On Mon, Jul 30, 2012 at 4:45 AM, <Koen.Vanderkimpen@...> wrote:
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:


<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.


I tried lang(), but it expects an argument

I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?



Sincerely




Koen Vanderkimpen

Connect:

[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -
www.smals.be
Tel.
<a href=tel:%2B32%202%20787%204670 target=_blank>+32 2 787 4670
Fonsnylaan 20, lokaal 4-101

1060 Brussel







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.










Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.





--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: language-aware date on output

Erik Bruchez
Administrator
Hi,

No, it's not normal! Where do you use the function, and with what version of Form Builder?

-Erik

On Tue, Oct 9, 2012 at 8:44 AM, <[hidden email]> wrote:
Hi,

I recently saw a reason to get back on this.

xxforms:lang() does not seem to work in xpath expressions in forms made using form builder. Is this normal?

Bye,


Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter

"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        Koen Vanderkimpen/Smals
To:        [hidden email]
Date:        21/08/2012 14:24
Subject:        Re: [ops-users] Re: language-aware date on output



Hi Eric,

So will the dates be language-aware in the next release?


In the mean time, I still have to use 3.9, so what's a simple syntax to make the dates purely numerical?

Thx,



Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter






From:        Erik Bruchez <[hidden email]>
To:        [hidden email]
Date:        31/07/2012 21:32
Subject:        [ops-users] Re: language-aware date on output
Sent by:        [hidden email]




Koen,

Good point. What we had in mind at some point was to introduce new properties taking the language into consideration.

However, since then we have added the xxforms:lang() function. And I think that it's better to simply use that function in the existing properties. So, I have done just this, and as you have noticed, there is an issue with an undeclared prefix. So I have also fixed that and committed a change which makes the formats properties language aware.

https://github.com/orbeon/orbeon-forms/commit/120950543143db2b9427c60e901ec5ac7eb98542

In order for this to work, there must be an xml:lang attribute in the form. You can place that attribute on the root element of the document for example.

-Erik

On Mon, Jul 30, 2012 at 4:45 AM, <[hidden email]> wrote:
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:


<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.


I tried lang(), but it expects an argument

I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?



Sincerely




Koen Vanderkimpen

Connect:


[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -
www.smals.be
Tel.
<a href="tel:%2B32%202%20787%204670" target="_blank">+32 2 787 4670
Fonsnylaan 20, lokaal 4-101

1060 Brussel







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.










Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.






--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: language-aware date on output

koenvdk
Hi,

It's 3.9.1PE, and we would like to use it in xpath expressions in calculated output fields, to internationalize them (normally, only the label is internationalized, but we need a dynamic field, or at least one that will allow html code instead of mere strings).

As a workaround, we use xxforms:instance(fr-language-instance), but this variable only gets initialized after explicitly switching the language, while we need something that works from the moment a form is loaded, using ../new?fr-language=xx .


Bye,



Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter

"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        Erik Bruchez <[hidden email]>
To:        [hidden email]
Date:        10/10/2012 06:30
Subject:        [ops-users] Re: Re: Re: language-aware date on output
Sent by:        [hidden email]




Hi,

No, it's not normal! Where do you use the function, and with what version of Form Builder?

-Erik

On Tue, Oct 9, 2012 at 8:44 AM, <Koen.Vanderkimpen@...> wrote:
Hi,

I recently saw a reason to get back on this.


xxforms:lang() does not seem to work in xpath expressions in forms made using form builder. Is this normal?


Bye,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:


"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        
Koen Vanderkimpen/Smals
To:        
[hidden email]
Date:        
21/08/2012 14:24
Subject:        
Re: [ops-users] Re: language-aware date on output




Hi Eric,


So will the dates be language-aware in the next release?



In the mean time, I still have to use 3.9, so what's a simple syntax to make the dates purely numerical?


Thx,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:







From:        
Erik Bruchez <ebruchez@...>
To:        
[hidden email]
Date:        
31/07/2012 21:32
Subject:        
[ops-users] Re: language-aware date on output
Sent by:        
ebruchez@...




Koen,

Good point. What we had in mind at some point was to introduce new properties taking the language into consideration.

However, since then we have added the xxforms:lang() function. And I think that it's better to simply use that function in the existing properties. So, I have done just this, and as you have noticed, there is an issue with an undeclared prefix. So I have also fixed that and committed a change which makes the formats properties language aware.

https://github.com/orbeon/orbeon-forms/commit/120950543143db2b9427c60e901ec5ac7eb98542

In order for this to work, there must be an xml:lang attribute in the form. You can place that attribute on the root element of the document for example.

-Erik

On Mon, Jul 30, 2012 at 4:45 AM, <
Koen.Vanderkimpen@...> wrote:
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:


<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.


I tried lang(), but it expects an argument

I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?



Sincerely




Koen Vanderkimpen

Connect:


[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -

www.smals.be
Tel.
<a href=tel:%2B32%202%20787%204670 target=_blank>+32 2 787 4670
Fonsnylaan 20, lokaal 4-101

1060 Brussel






Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.





--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: language-aware date on output

Erik Bruchez
Administrator
So you mean on a bind, like <xforms:bind ... calculate="xxforms:lang()"> ?

-Erik

On Wed, Oct 10, 2012 at 12:29 AM, <[hidden email]> wrote:
Hi,

It's 3.9.1PE, and we would like to use it in xpath expressions in calculated output fields, to internationalize them (normally, only the label is internationalized, but we need a dynamic field, or at least one that will allow html code instead of mere strings).

As a workaround, we use xxforms:instance(fr-language-instance), but this variable only gets initialized after explicitly switching the language, while we need something that works from the moment a form is loaded, using ../new?fr-language=xx .


Bye,



Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter

"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        Erik Bruchez <[hidden email]>
To:        [hidden email]
Date:        10/10/2012 06:30
Subject:        [ops-users] Re: Re: Re: language-aware date on output
Sent by:        [hidden email]




Hi,

No, it's not normal! Where do you use the function, and with what version of Form Builder?

-Erik

On Tue, Oct 9, 2012 at 8:44 AM, <[hidden email]> wrote:
Hi,

I recently saw a reason to get back on this.


xxforms:lang() does not seem to work in xpath expressions in forms made using form builder. Is this normal?


Bye,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:


"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        
Koen Vanderkimpen/Smals
To:        
[hidden email]
Date:        
21/08/2012 14:24
Subject:        
Re: [ops-users] Re: language-aware date on output




Hi Eric,


So will the dates be language-aware in the next release?



In the mean time, I still have to use 3.9, so what's a simple syntax to make the dates purely numerical?


Thx,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:







From:        
Erik Bruchez <[hidden email]>
To:        
[hidden email]
Date:        
31/07/2012 21:32
Subject:        
[ops-users] Re: language-aware date on output
Sent by:        
[hidden email]




Koen,

Good point. What we had in mind at some point was to introduce new properties taking the language into consideration.

However, since then we have added the xxforms:lang() function. And I think that it's better to simply use that function in the existing properties. So, I have done just this, and as you have noticed, there is an issue with an undeclared prefix. So I have also fixed that and committed a change which makes the formats properties language aware.

https://github.com/orbeon/orbeon-forms/commit/120950543143db2b9427c60e901ec5ac7eb98542

In order for this to work, there must be an xml:lang attribute in the form. You can place that attribute on the root element of the document for example.

-Erik

On Mon, Jul 30, 2012 at 4:45 AM, <
[hidden email]> wrote:
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:


<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.


I tried lang(), but it expects an argument

I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?



Sincerely




Koen Vanderkimpen

Connect:


[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -

www.smals.be
Tel.
<a href="tel:%2B32%202%20787%204670" target="_blank">+32 2 787 4670
Fonsnylaan 20, lokaal 4-101

1060 Brussel






Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.






--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: language-aware date on output

koenvdk
Yes, I think so,

in the calculate or initial attributes (configured via the builder, using the little red exclamation mark button) of a control.

Groetjes,



Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter

"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        Erik Bruchez <[hidden email]>
To:        [hidden email]
Date:        17/10/2012 07:41
Subject:        [ops-users] Re: Re: Re: Re: Re: language-aware date on output
Sent by:        [hidden email]




So you mean on a bind, like <xforms:bind ... calculate="xxforms:lang()"> ?

-Erik

On Wed, Oct 10, 2012 at 12:29 AM, <Koen.Vanderkimpen@...> wrote:
Hi,

It's 3.9.1PE, and we would like to use it in xpath expressions in calculated output fields, to internationalize them (normally, only the label is internationalized, but we need a dynamic field, or at least one that will allow html code instead of mere strings).


As a workaround, we use xxforms:instance(fr-language-instance), but this variable only gets initialized after explicitly switching the language, while we need something that works from the moment a form is loaded, using ../new?fr-language=xx .



Bye,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:


"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors"
(Phil Karlton et al)





From:        Erik Bruchez <ebruchez@...>
To:        
[hidden email]
Date:        10/10/2012 06:30
Subject:        
[ops-users] Re: Re: Re: language-aware date on output
Sent by:        
ebruchez@...




Hi,

No, it's not normal! Where do you use the function, and with what version of Form Builder?

-Erik

On Tue, Oct 9, 2012 at 8:44 AM, <
Koen.Vanderkimpen@...> wrote:
Hi,


I recently saw a reason to get back on this.


xxforms:lang() does not seem to work in xpath expressions in forms made using form builder. Is this normal?


Bye,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:


"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        
Koen Vanderkimpen/Smals
To:        
[hidden email]
Date:        
21/08/2012 14:24
Subject:        
Re: [ops-users] Re: language-aware date on output




Hi Eric,


So will the dates be language-aware in the next release?



In the mean time, I still have to use 3.9, so what's a simple syntax to make the dates purely numerical?


Thx,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:







From:        
Erik Bruchez <ebruchez@...>
To:        
[hidden email]
Date:        
31/07/2012 21:32
Subject:        
[ops-users] Re: language-aware date on output
Sent by:        
ebruchez@...




Koen,

Good point. What we had in mind at some point was to introduce new properties taking the language into consideration.

However, since then we have added the xxforms:lang() function. And I think that it's better to simply use that function in the existing properties. So, I have done just this, and as you have noticed, there is an issue with an undeclared prefix. So I have also fixed that and committed a change which makes the formats properties language aware.


https://github.com/orbeon/orbeon-forms/commit/120950543143db2b9427c60e901ec5ac7eb98542

In order for this to work, there must be an xml:lang attribute in the form. You can place that attribute on the root element of the document for example.

-Erik

On Mon, Jul 30, 2012 at 4:45 AM, <
Koen.Vanderkimpen@...> wrote:
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:


<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.


I tried lang(), but it expects an argument

I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?



Sincerely




Koen Vanderkimpen

Connect:


[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -

www.smals.be
Tel.
<a href=tel:%2B32%202%20787%204670 target=_blank>+32 2 787 4670
Fonsnylaan 20, lokaal 4-101

1060 Brussel






Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws






Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.





--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Re: language-aware date on output

Erik Bruchez
Administrator
We recently fixed an issue with the xxforms:lang() function, which didn't work in variables:

https://github.com/orbeon/orbeon-forms/issues/495

I suspect there might also be a problem when using them within models. Just in case, I am entering an issue for this:

https://github.com/orbeon/orbeon-forms/issues/512

-Erik

On Thu, Oct 18, 2012 at 3:41 AM, <[hidden email]> wrote:
Yes, I think so,

in the calculate or initial attributes (configured via the builder, using the little red exclamation mark button) of a control.

Groetjes,



Koen Vanderkimpen
Research/Recherche/Onderzoek

Connect: Twitter

"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        Erik Bruchez <[hidden email]>
To:        [hidden email]
Date:        17/10/2012 07:41
Subject:        [ops-users] Re: Re: Re: Re: Re: language-aware date on output
Sent by:        [hidden email]




So you mean on a bind, like <xforms:bind ... calculate="xxforms:lang()"> ?

-Erik

On Wed, Oct 10, 2012 at 12:29 AM, <[hidden email]> wrote:
Hi,

It's 3.9.1PE, and we would like to use it in xpath expressions in calculated output fields, to internationalize them (normally, only the label is internationalized, but we need a dynamic field, or at least one that will allow html code instead of mere strings).


As a workaround, we use xxforms:instance(fr-language-instance), but this variable only gets initialized after explicitly switching the language, while we need something that works from the moment a form is loaded, using ../new?fr-language=xx .



Bye,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:


"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors"
(Phil Karlton et al)





From:        Erik Bruchez <[hidden email]>
To:        
[hidden email]
Date:        10/10/2012 06:30
Subject:        
[ops-users] Re: Re: Re: language-aware date on output
Sent by:        
[hidden email]




Hi,

No, it's not normal! Where do you use the function, and with what version of Form Builder?

-Erik

On Tue, Oct 9, 2012 at 8:44 AM, <
[hidden email]> wrote:
Hi,


I recently saw a reason to get back on this.


xxforms:lang() does not seem to work in xpath expressions in forms made using form builder. Is this normal?


Bye,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:


"there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors" (Phil Karlton et al)





From:        
Koen Vanderkimpen/Smals
To:        
[hidden email]
Date:        
21/08/2012 14:24
Subject:        
Re: [ops-users] Re: language-aware date on output




Hi Eric,


So will the dates be language-aware in the next release?



In the mean time, I still have to use 3.9, so what's a simple syntax to make the dates purely numerical?


Thx,



Koen Vanderkimpen

Research/Recherche/Onderzoek


Connect:







From:        
Erik Bruchez <[hidden email]>
To:        
[hidden email]
Date:        
31/07/2012 21:32
Subject:        
[ops-users] Re: language-aware date on output
Sent by:        
[hidden email]




Koen,

Good point. What we had in mind at some point was to introduce new properties taking the language into consideration.

However, since then we have added the xxforms:lang() function. And I think that it's better to simply use that function in the existing properties. So, I have done just this, and as you have noticed, there is an issue with an undeclared prefix. So I have also fixed that and committed a change which makes the formats properties language aware.


https://github.com/orbeon/orbeon-forms/commit/120950543143db2b9427c60e901ec5ac7eb98542

In order for this to work, there must be an xml:lang attribute in the form. You can place that attribute on the root element of the document for example.

-Erik

On Mon, Jul 30, 2012 at 4:45 AM, <
[hidden email]> wrote:
Hi,

I'm trying to use the properties-local.xml to configure what dates look like in the output. Here's what I have what works:


<property as="xs:string"  name="oxf.xforms.format.output.*.*.date"          value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.*.*.dateTime"   value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string"  name="oxf.xforms.format.output.date"               value="if (. castable as xs:date) then format-date(xs:date(.), '[FNn] [D] [MNn], [Y] [ZN]', 'en', (), ()) else ."/>

<property as="xs:string" name="oxf.xforms.format.output.dateTime"        value="if (. castable as xs:dateTime) then format-dateTime(xs:dateTime(.), '[FNn] [D] [MNn], [Y] [H01]:[m01]:[s01] [ZN]', 'en', (), ()) else ."/>

   
However, the date always shows in english ("Saturday ..."). Obviously, this is because of the 'en' argument, but I can't figure out how to make this argument dynamic, so that it uses the currently active language in the form.


I tried lang(), but it expects an argument

I tried xxforms:lang(), but it complains about xxforms not being declared
I tried the variable $fr-language, but that doesn't here either



How can I make the date on outputs, like pdf, multi-language?



Sincerely




Koen Vanderkimpen

Connect:


[hidden email]
IT Consulent - Sectie Onderzoek
Afdeling Klanten en Diensten
Smals -

www.smals.be
Tel.
<a href="tel:%2B32%202%20787%204670" target="_blank">+32 2 787 4670
Fonsnylaan 20, lokaal 4-101

1060 Brussel






Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws






Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.






--
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
OW2 mailing lists service home page: http://www.ow2.org/wws