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:
-- 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 |
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, -- 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 |
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, <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:
-- 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 |
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, -- 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 |
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: "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, <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:
-- 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 |
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, -- 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 |
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, <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
-- 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 |
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, -- 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 |
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: "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
-- 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 |
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, -- 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 |
Free forum by Nabble | Edit this page |