Moonsoft Software Solutions

Locale setting for languages

Started 9 Jun 2024 · 3 replies

  1. Porter
    Hello.
    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.
  2. Moonsoft support
    Hi,
    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:

    https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_date-format

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

    15 - avr - 2024


    Hope this helps, regards
    Guillermo V.
    Moonsoft Team

  3. Porter
    That did the trick nicely, thank you!
  4. Porter
    Proposal accepted!

Still stuck?

Customers with an active license can open a support ticket.

Log in to open a ticket