enhancement language
avatar Sandra97
Sandra97
10 Jul 2016

Steps to reproduce the issue

If you go to this page for example: [https://issues.joomla.org/activity/user/joomla-cms?lang=en-GB](user tracker activity), and display it in French (or any other language), and then, display the chart with a custom period, you'll see that the months at the top of the chart are displayed in English.
Would it be possible to make them translatable?

cms - graphique d activite des utilisateurs 2016-07-10 14-08-17

avatar Sandra97 Sandra97 - open - 10 Jul 2016
avatar mbabker
mbabker - comment - 10 Jul 2016

Well there are two options. Either use a 100% numeric date (i.e. 01-05-2016) or implement our own DateTime object to handle formatting the same way JDate in the CMS does. Unfortunately translating anything from PHP's date functions is tricky.

avatar brianteeman
brianteeman - comment - 10 Jul 2016

Thanks to the USA I don't recommend using a pure numeric format.

avatar mbabker
mbabker - comment - 10 Jul 2016

And without introducing the CMS' concept of translatable date/time formats all of the day-month-year notations aren't correct for us.

avatar mbabker
mbabker - comment - 10 Jul 2016

Another possibility might be to dig deep into the PHP API and make use of the intl extension

avatar mbabker
mbabker - comment - 10 Jul 2016

Just deployed 75d39f5 which uses the PHP intl extension to format the dates, and translate them. I've gone through a large chunk of the languages and things seem to be fine with that snippet, so if that's the case we could make the same change to other date labels in the charts and call this complete.

avatar elkuku
elkuku - comment - 10 Jul 2016

I am, once again, surprised by the way you find simple solutions to problems that are quite complex...
I am, almost, even more surprised that we can use the intl extension on our live server environment.
Can our non *nix devs get that thing installed? @b2z?

Should become part of the language handling class ?

avatar mbabker
mbabker - comment - 10 Jul 2016

Shouldn't be too complex to install. Per the documentation it's just passing a flag when you compile PHP, so if you're using an *AMP stack it would be dependent on how that was built. And at least from what I've seen it's enabled on any decent hosting provider these days. And if for whatever reason you CAN'T get the intl extension, there's Symfony's intl component (sadly only supports English, but at least keeps your code from erroring out).

avatar b2z
b2z - comment - 15 Jul 2016

I did not have a problem with it - my WampServer installation has php-intl package ;)

avatar b2z b2z - change - 15 Jul 2016
Labels Added: enhancement language
avatar mbabker mbabker - change - 12 Mar 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-03-12 14:22:48
Closed_By mbabker
avatar mbabker mbabker - close - 12 Mar 2020

Add a Comment

Login with GitHub to post a comment