Not translating day/month names

  • ABPro Support
  • Topic Author
  • Offline
  • Moderator
  • Moderator
More
8 years 6 months ago - 6 years 4 months ago #12243 by ABPro Support
Not translating day/month names was created by ABPro Support
ABPro does not translate day/month names
PHP and MySQL do day/month name translation.

ABPro passes the language code, it reads from your Joomla, to the setlocale() php function.
Once that is done, any php Date() functions will return the day/month names in the correct language.

ABPro used MySQL's lc_time_names call to do the same for database calls. MySQL decides what day/month name to send back.

The translation takes place automatically and requires nothing to be done on your part. If you set your site language to French. ABPro's dates will display with French day/month names.


Some sites/languages seem to not set properly. I cannot say why as I have never been able to reproduce the issue.

#EDIT September 2014 #

One of these two items seem to fix it most of the time.

In file ABPro file gad_ajax.php around line 78 look for:

$lang =& JFactory::getLanguage();
setlocale(LC_TIME, str_replace("-", "_", $lang->getTag()));


Add red code to specify utf-8
setlocale(LC_TIME, str_replace("-", "_", $lang->getTag()).".UTF8");


If you have Time on Y-Axis = Yes, you will need to add the same mod to file gad_ajax2.php.

If you are running a Windows server you need to spell out the language..

Change
setlocale(LC_TIME, str_replace("-", "_", $lang->getTag()));
to
setlocale(LC_TIME,"swedish");

Names can be found here..
msdn.microsoft.com/en-ca/library/39cwe7zf(v=vs.80).aspx

If neither of the above fixed the problem, read on...


If your site is not translating and you have set the Joomla language, you might try hard coding the language code.

In file ABPro file gad_ajax.php around line 57 look for:

$lang =& JFactory::getLanguage();
setlocale(LC_TIME, str_replace("-", "_", $lang->getTag()));


Change to your language code (the example sets to de_DE for German)
setlocale(LC_TIME, "de_DE");

The above code snippet only works if you have Time on Y-Axis = No.
If yours is set to yes, you might try the same change in file gad_ajax2.php as that is the file that builds the grid if you have Time on Y-Axis =Yes
See also, the manual entry on php setloacle(), there are some other paramenters that may help.
php.net/manual/en/function.setlocale.php


### UPDATE ###
Windows servers want the name not the code for a php setlocale.
Change
setlocale(LC_TIME, str_replace("-", "_", $lang->getTag()));
to
setlocale(LC_TIME,"swedish");

Names can be found here..
msdn.microsoft.com/en-ca/library/39cwe7zf(v=vs.80).aspx

### ANOTHER UPDATE ###
For Swedish, on a Linux server see
appointmentbookingpro.com/component/kune...mid=0&start=12#13873

### ANOTHER UPDATE ###
Greek is a problem, this works on a Linux server..
setlocale(LC_TIME, array('el_GR.UTF-8','el_GR','greek'));




If the case of dates in SQL queries, ABPro passes the Joomla language code to MySQL in an lc_time_names call and MySQL returns the correct translation.
Again also, normally this all works without any intervention by you as long as the Joomla language code is set correctly.

You can try hard coding the call. For the confirmation messages edit file:
\administrator\components\com_rsappt_pro2\sendmail_pro2.php

Search for:
$sql = "SET lc_time_names

You will find 3 occurrences. Change the call to hard code your language code.
For more info on lc_time_names see
dev.mysql.com/doc/refman/5.0/en/locale-support.html



Additionally, if some charters are not displaying correctly..
The data sent to the client is treated slightly different on a Windows server vs Linux. ABPro tries to determine which it is running on but may not be setting the WINDOWS directive correctly on your site.

In file \components\com_rsappt_pro2\rsappt_pro2.php

Around line 29 look for:
if (substr(PHP_OS, 0, 3) == 'WIN') {
define("WINDOWS", true);
} else {
define("WINDOWS", false);
}

Try just hard coding one way then the other to see which works.

For example:
//if (substr(PHP_OS, 0, 3) == 'WIN') {
//define("WINDOWS", true);
//} else {
define("WINDOWS", false);
//}
Last edit: 6 years 4 months ago by Rob.
The following user(s) said Thank You: Putois

Please Log in to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum

Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013