List Manager Forum

Locale setting for languages

User Porter 2024-06-09 09:12:29

Is it possible to control how to display the local language if you e.g., want to display days and months?
It seems as if it's only English right now, even if I've set another Joomla language.

Moonsoft support 2024-06-10 10:48:57

yes, the php date function only shows the output in English, there was a date format function that allowed to set a different locale but it has been deprecated for PHP8. In order to show different texts for week dates or months you can try a different approach:

- Set the field type as 'calculated sql'

- Insert a query at the Data/Values->Calculated Query configuration

SELECT DATE_FORMAT(yourfield,'%d - %b - %Y','fr_FR') AS yourfield FROM yourtable where id_internal=##id_internal##;

Replacing yourfield and yourtable for your proper field and table names. Instead of 'fr_FR' you can set your desired locale. Please note the date format function from your database has different characters to set the output configuration, you can check them here:

So at this example '%d - %b - %Y' will print values like

15 - avr - 2024

Hope this helps, regards
Guillermo V.
Moonsoft Team

User Porter 2024-06-10 12:52:42

That did the trick nicely, thank you!

User Porter 2024-06-12 17:04:54

Proposal accepted!


Perfect for small code changes or to correct any bug at your site

Buy now!

Create dynamic calculators

Buy now!