How to set language for "date picker" form control

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
ArthurP
Posts: 11
Joined: Mon Dec 11, 2023 3:10 pm

How to set language for "date picker" form control

Post by ArthurP »

Hi,

how can I set the language for "date picker" form control in a web application ? For instance, french.
Our document have

Code: Select all

xml:lang="fr_FR"
set on the root and the user interface is also set to "french" but the date is write in english. I tried to set language in URL with lang=fr without success too. Maybe, this is something to be set on java level ? or when the webapp is starting ?

I have no problem with desktop version of these framework.

Our CSS looks like

Code: Select all

  content: 
  oxy_datePicker(
edit, '#text', 
columns, 16, validateInput, 'true', 
format, 'dd MMMMMMMM yyyy', fontInherit, 'true', color, 'darkblue');
  visibility: -oxy-collapse-text;
}
Thanks !
cosminef
Site Admin
Posts: 84
Joined: Wed Aug 30, 2023 2:33 pm

Re: How to set language for "date picker" form control

Post by cosminef »

Hello,

In order for the oxy_datePicker to display a specific date format, it is necessary to check the following aspects:

1. The way the date format is displayed depends on the default system locale settings.
On Windows, you can find this option in Control Panel: Click Start > Settings > Control Panel. Double-click Regional Settings (or Regional Options) and select your desired format. in order for it to take effect in Web Author, you need to close and reopen the browser.

2. The language in the browser also needs to be changed:
For example, in Google Chrome, follow this steps:

- At the top-right of the address bar, click the three dots, and click Settings.
- From the left side of Chrome, click Languages.
- Click Add languages: English (United Kingdom) for dd/mm/yyyy format. ...
- Click the three dots against the chosen language. ...
- Restart the Chrome browser for the changes to reflect.

Best Regards,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
ArthurP
Posts: 11
Joined: Mon Dec 11, 2023 3:10 pm

Re: How to set language for "date picker" form control

Post by ArthurP »

Hi Cosmin,

Thanks for answering. My locale is set to "French" on my system (MacOs) and in Firefox also. But the data picker still uses an english date (ex: "November" instead of "novembre").
Is there an other way to set this parameter ? Maybe it's something related to webauthor configuration on server ?
cosminef
Site Admin
Posts: 84
Joined: Wed Aug 30, 2023 2:33 pm

Re: How to set language for "date picker" form control

Post by cosminef »

Hello,

Can you modify your format in CSS code, like this:

Code: Select all

format, 'dd MMMM yyyy'
and see if with this change,it works.

Best,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
ArthurP
Posts: 11
Joined: Mon Dec 11, 2023 3:10 pm

Re: How to set language for "date picker" form control

Post by ArthurP »

Hi Cosmin,

unfortunatly, changing it to

Code: Select all

format, 'dd MMMM yyyy'
does nothing
cosminef
Site Admin
Posts: 84
Joined: Wed Aug 30, 2023 2:33 pm

Re: How to set language for "date picker" form control

Post by cosminef »

Hello,
After you have made the changes discussed above, have you stopped and restarted the Web Author application?

Best,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
ArthurP
Posts: 11
Joined: Mon Dec 11, 2023 3:10 pm

Re: How to set language for "date picker" form control

Post by ArthurP »

Hello,

yes the Webapp was restarted.
does date picker language depend on client side or server side ?
cosminef
Site Admin
Posts: 84
Joined: Wed Aug 30, 2023 2:33 pm

Re: How to set language for "date picker" form control

Post by cosminef »

Hello,
We managed to reproduce the issue you reported, and we have recorded an issue (WA-6939) on this matter.
Normally, for the language change to take effect for datePicker, you just need to have xml:lang set (which you have already confirmed in your case), and the desired language should be selected from the Web Author application interface.
Once we have a solution in this regard, we will notify you here on the forum.

Best Regards,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
ArthurP
Posts: 11
Joined: Mon Dec 11, 2023 3:10 pm

Re: How to set language for "date picker" form control

Post by ArthurP »

Hello,
thanks for looking into it!

have a nice day
Post Reply