Date format Issue with multi-language

Hi everyone,

I am a big beginer on WeWeb so I practice for learning.
I want to create a multi-language page with a format date.

Below my process :
First of all, I add a language in clicking “More”

Then, I parameterized the language page in clicking the gear icon :

Then I created a Text element with binding for french and the righ format date for the french world

Then thebinding for english and the righ format date for the english world in the same text element

Then I created a button “FR” and when we click on it, the date should be in french format with the workflow below

Then I created a button “EN” and when we click on it, the date should be in english format with the workflow below

When I preview the page, and the button “FR” is clicker everything is fine :

BUT when I’m clicking on the button “EN”, the format date is right “MMMM DD YYYY”, the Month is in French

Thank you so much
Thomas

Hi Thomas and welcome to the community :waving_hand:

The language is being pulled directly from your browser automatically.

The best way to solve this in my opinion is to install the Date Plugin:

From there you can use formulas to edit your timezone and time elements:

In this case I’m using the “formatDate” formula with 3 parameters (Actual Date, Format, Locale)
1- Actual Date I pass the current date with another formula (Date())
2- Format is how I want to format the date, by putting 4 M’s I tell it I want to have my month written.
3- Locale is the browser locale and language, and here is where you are going to put “en” for english and “fr” for french

From this you just need to create a logic to change between those two.

Hope this helps.

1 Like

It works so well!
Thank you so much

1 Like