Hi,
I started to use ChronoForms and it is powerfull. I searched forums, but I didn't found how to made a multi language calendar. There are mamy posts about this problem, but I must to switch the calendar if I switch the language with Joom!Fish. I tried to put some code into HTML section of form, but it doesn't work.
I tried with this:
I think the problem is in $mosConfig_lang=='polish' statement. Who knows how to check current language?
Sorry if my english is not very well.
Marzyslaw
I started to use ChronoForms and it is powerfull. I searched forums, but I didn't found how to made a multi language calendar. There are mamy posts about this problem, but I must to switch the calendar if I switch the language with Joom!Fish. I tried to put some code into HTML section of form, but it doesn't work.
I tried with this:
<?php
$doc = & JFactory::getDocument();
global $mosConfig_lang;
if ($mosConfig_lang=='polish'){
$script = "
window .addEvent('domready', function() {
myCal_date_1 = new Calendar({date_1: 'd/m/Y'},
{
classes: ['dashboard'],
months: ['Styczen', 'Luty', 'Marzec', 'Kwiecien', 'Maj', 'Czerwiec', 'Lipiec',
'Sierpien', 'Wrzesien', 'PaĆșdziernik', 'Listopad', 'Grudzien']
});
});
";
}
else{
$script = "
window .addEvent('domready', function() {
myCal_date_1 = new Calendar({date_1: 'd-m-Y'},
{
classes: ['dashboard']
});
});
";
}
$doc->addScriptDeclaration($script);
?>
I think the problem is in $mosConfig_lang=='polish' statement. Who knows how to check current language?
Sorry if my english is not very well.
Marzyslaw
Hi Marzyslaw,
Bob
$lang =& JFactory::getLanguage();
$LangTag = $lang->getTag();
Bob
Thank you Bob!
But I don't know in which part of my code I should put lines you mentioned. Or my code is not correct.
Marzyslaw
But I don't know in which part of my code I should put lines you mentioned. Or my code is not correct.
Marzyslaw
Hi Maryszlaw,
$lang->getTag() will give you the language tag like en-GB or pl-PL; $lang->getName() will give you the name but the Tag is the better code to use.
Bob
$lang->getTag() will give you the language tag like en-GB or pl-PL; $lang->getName() will give you the name but the Tag is the better code to use.
Bob
Hi Bob!
I've one more question. When I started to use the mentioned code I've a problem with Multi Language PlugIn. It seems like it not working. Why? Should I translate whole form in HTML window?
I've one more question. When I started to use the mentioned code I've a problem with Multi Language PlugIn. It seems like it not working. Why? Should I translate whole form in HTML window?
Hi Maryszlaw,
It shouldn't have any effect on the Plugin, they both use the same code but I can't see why that would be a problem :-(
I don't have time to look now, added to the 'to-do' list.
Bob
It shouldn't have any effect on the Plugin, they both use the same code but I can't see why that would be a problem :-(
I don't have time to look now, added to the 'to-do' list.
Bob
This topic is locked and no more replies can be posted.