I am not a programmer but I know my way around Joomla and PHP enough to have found a solution to display the calendars in quick contact in at least 2 different languages.
It may help somebody in the future who?s looking to display the calendars in different languages.
Take note. This simple solution will allow the user to select a date on the calendar in their native language but, when a selection is made, the post to the form will revert to English. But at least you allowed you user to make the selection in their native language.
You will need to modify the following files:
joomla_root/modules/mod_s5_quick_contact/tmpl/default.php
joomla_root/modules/mod_s5_quick_contact/s5_quick_contact/pikaday.js
1. First make a copy / backup of these 2 files just in case something goes wrong.
2. Make 2 more copies of the pikaday.js file and leave them in the same folder along with the original.
Rename 1 copy of this file to:
pikaday_en.js
( for english )
Rename the other copy of the file to:
pikaday_es.js
( I needed the calendar in spanish hence the: _es in the file name. You can rename your files to whatever you wish but adding the lang specific prefix helps to keep everything in order. eg, for french you coud rename to pikladay_fr.js )
3. Now open your:
pikaday_es.js
Go to line 241. it reads:
i18n: {
Below this line you will see the words to be translated.
i.e:
previousMonth : 'Previous Month',
For spanish you would change this line to
previousMonth : 'Mes Anterior',
Translate all the days, months, abbreviations etc. to the desired language.
Save the file and close.
4. Now go to:
joomla_root/modules/mod_s5_quick_contact/tmpl/
and open:
default.php
remember to make a backup of this file as well just in case you make a mistake when you alter the original code.
Go to line 195. it reads like this:
$doc->addCustomTag('<script src="'.$s5_qc_url.'s5_quick_contact/pikaday.js" type="text/javascript"></script>');
Replace that line with:
$lang = JFactory::getLanguage();
if ($lang->getTag() == 'en-GB') {
$doc->addCustomTag('<script src="'.$s5_qc_url.'s5_quick_contact/pikaday_en.js" type="text/javascript"></script>');
}
$lang = JFactory::getLanguage();
if ($lang->getTag() == 'es-ES') {
$doc->addCustomTag('<script src="'.$s5_qc_url.'s5_quick_contact/pikaday_es.js" type="text/javascript"></script>');
}
The first string of code defines what js file to look for when the site language is English.
The second string of code defines what js file to look for when the site language is Spanish. Replace the variables in the second string of code to your specific language and remember to replace the file names to whatever names you used in step 2.
Clear your browser cache, reload your site and you should have the calendar displaying different languages automatically depending on the user selected language.
I repeat:
This is a simple / humble solution to let the user be able to make a selection from the calendar in their native language. After the user makes the selection, the calendar posts the calendar selection to the form in English.
I?m not a programmer so please don?t ask me for custom PHP code. I played around with the code and googled a little bit for joomla specific language code and was lucky enough to get it to work.
enjoy,