Jump to content
  • 0

Wrong Date Format In Support Manager Plugin (Ticket Detail)


wantoo

Question

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

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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 .

Link to comment
Share on other sites

  • 0

open the blesta.php in config

 

add setlocale with your country and try it .

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

 

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.

 

 

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)

 

 

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...

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...