Jump to content
  • 0

Wrong Date Format In Support Manager Plugin (Ticket Detail)


Question

Posted

Hello,

 

Blesta 3.5.2 settled in EN & FR language, FR by default in admin parameters (UTC +02:00-Paris + Country France), I got wrong date format in Ticket detail/reply:

 

I need to precise that I've changed /plugin/support_manager/config/support_manager.php file value

Configure::set("SupportManager.time_format", "H:i:s");
Configure::set("SupportManager.reply_date_format", "l j F Y H:i");

But, with any navigator in French (tested with Chrome, Firefox) I got:

 

"Le Monday 10 August 2015 13:15 Système a répondu"

instead of

"Le Lundi 10 Août 2015 13:15 Système a répondu"...

 

FR is active (in green) but PHP locale Date is wrong... Is there a missing "setlocale" somewhere?

 

Thanks ;)

 

Best regards

 

Didier

10 answers to this question

Recommended Posts

  • 0
Posted

Yes, every single word are fine, translated and checked... except date which is not a translated string but a php date() function. A value coming from database and formatted to "l j F Y H:i".

 

It could be a "setlocale" problem, maybe in Blesta, maybe in my php.ini. I do have to check that.

  • 0
Posted

Date descriptors like the month name or day of the week use the system's default locale. You can set the default locale in your php.ini file. It is probably set to en_US by default.

 

You could change the locale so that date descriptors will appear in French, but then they would always appear in French regardless of the language you're using in Blesta. There is no internationalization support for the date descriptors based on language selected in Blesta.

 

You could either set an appropriate default locale suitable for all users as I mentioned above, or not use date descriptors like "F" and "l" in your date format.

  • 0
Posted
  On 8/18/2015 at 11:44 PM, Tyson said:

Date descriptors like the month name or day of the week use the system's default locale. You can set the default locale in your php.ini file. It is probably set to en_US by default.

 

You could change the locale so that date descriptors will appear in French, but then they would always appear in French regardless of the language you're using in Blesta. There is no internationalization support for the date descriptors based on language selected in Blesta.

 

You could either set an appropriate default locale suitable for all users as I mentioned above, or not use date descriptors like "F" and "l" in your date format.

 

that is because blesta is not using strftime() to generate dates .. the setlocale is applicable only in strftime() .

 

just to note this is another approuch for a the true multilanguage system .

  • 0
Posted
  On 8/18/2015 at 4:48 PM, naja7host said:

open the blesta.php in config

 

add setlocale with your country and try it .

Doesn't work. Even elsewhere in other files (helpers)

 

  On 8/18/2015 at 11:44 PM, Tyson said:

Date descriptors like the month name or day of the week use the system's default locale. You can set the default locale in your php.ini file. It is probably set to en_US by default.

 

You could change the locale so that date descriptors will appear in French, but then they would always appear in French regardless of the language you're using in Blesta. There is no internationalization support for the date descriptors based on language selected in Blesta.

That's right. I've thought about that, all website date would be in french even for US users.

 

 

  On 8/18/2015 at 11:44 PM, Tyson said:
You could either set an appropriate default locale suitable for all users as I mentioned above, or not use date descriptors like "F" and "l" in your date format.

 

You are right, I rolled back and settled "d/m/Y H:i" for now. Solutions above are not suitable because:

- "le monday 10 august 2015 utilisateur a dit" is not very handy for french users

- "on lundi 10 août 2015 user said" is worst for english spoken users (a few people on earth is supposed to speak french)

 

 

  On 8/19/2015 at 2:18 AM, naja7host said:

that is because blesta is not using strftime() to generate dates .. the setlocale is applicable only in strftime() .

 

just to note this is another approuch for a the true multilanguage system .

 

That's the point Naja7host! The little I have seen, date format function is executed from /helpers/date/date.php and, yes, there's no strftime()! Changing this needs a little somersault: date --> timestamp (strftime) --> date format again

 

I'm not sure if this is the only place to be in Blesta, the only function to hack...

  • 0
Posted

While using strftime would use the locale that is set, you still have to first change the locale with setlocale to match the language someone is using in Blesta. However, setlocale is not a thread-safe function. When multiple people are using your site at the same time, they may see dates in someone else's language. Worse, it will be an intermittent issue that comes and goes depending on other people using the system.

 

There is a way to use internationalized date names correctly, but it requires a newer version of php than our current minimum requirement of php 5.1.3.

  • 0
Posted

in an other website than blesta being for global market my date format is :

yyyy/mm/dd

 

so it's give: 2015/08/22

 

and EU or US, etc. are still able to understand it.

  • 0
Posted

in blesta , if you want to change all the date you need to make them in 1 or 2 day top cover all the areas . and in every upgrade we must re-edit the files agains :(

 

 

the setlocale is the only reasonable solution for such big areas , and is not affecting any server settings like php.ini .

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...