I'm feeling very stupid, but after reading everything about datepicker in this forum I still can't figure out how to configure the language for the timepicker.
Chronoforms version 4.0 RC3.4.1 on Joomla 2.5.4
Made js-action:
Works for calendar. Nicely showing daynames (abbreviated) as well as month names in Dutch.
Added this in DateTime Picker config
Calendar shows with starting date of today, field is filled with nicely formatted date and time en timewheelsteps are 10 minutes.
But: Timewheel language stays English. So the month is still formatted with a comma between the month and the year (language is ok) and the tooltip for the time stays English (Use the mouse wheel to quickly change value).
This happens with chronoforms preview (so without template) and with preview in site. So I suppose it can't be a javascript/jquery conflict.
What a I missing?
Chronoforms version 4.0 RC3.4.1 on Joomla 2.5.4
Made js-action:
Locale.use('nl-NL');
Works for calendar. Nicely showing daynames (abbreviated) as well as month names in Dutch.
Added this in DateTime Picker config
minDate: new Date(),format:'%e %B %Y om %H:%M',timeWheelStep: '10'
Calendar shows with starting date of today, field is filled with nicely formatted date and time en timewheelsteps are 10 minutes.
But: Timewheel language stays English. So the month is still formatted with a comma between the month and the year (language is ok) and the tooltip for the time stays English (Use the mouse wheel to quickly change value).
This happens with chronoforms preview (so without template) and with preview in site. So I suppose it can't be a javascript/jquery conflict.
What a I missing?
Hi Astrid,
Is this the MooTools datepicker? Then there is a little supplementary text file that should be being loaded it's at components/com_chronoforms/js/datepicker_moo/Locale.nl-NL.DatePicker.js and the contents are:
Bob
Is this the MooTools datepicker? Then there is a little supplementary text file that should be being loaded it's at components/com_chronoforms/js/datepicker_moo/Locale.nl-NL.DatePicker.js and the contents are:
Locale.define('nl-NL', 'DatePicker', {
select_a_time: 'Selecteer een tijd',
use_mouse_wheel: 'Gebruik uw scrollwiel om door de tijd te scrollen',
time_confirm_button: 'OK',
apply_range: 'OK',
cancel: 'Annuleer',
week: 'W'
});
If that were loaded would it fix your problems?Bob
Hi greyhead,
Thx for your reply. Yes, that's exactly the problem. I've seen the file with the right translation but it won't load.
Thx for your reply. Yes, that's exactly the problem. I've seen the file with the right translation but it won't load.
Hi Astrid,
Here's the code I used in the Show HTML [GH] action to load it. You should be able to use this in a Custom Code action:
Bob
Here's the code I used in the Show HTML [GH] action to load it. You should be able to use this in a Custom Code action:
<?php
$document =& JFactory::getDocument();
JHTML::_( 'behavior.mootools' );
$cf_url = JURI::root().'components/com_chronoforms/js/datepicker_moo/';
$tag = 'en-US';
$lang =& JFactory::getLanguage();
$lang_tag = $lang->getTag();
if ( !$lang_tag ) {
$lang_tag = $lang->getDefault();
}
if ( file_exists($cf_url.'Locale.'.$lang_tag.'.DatePicker.js') ) {
$tag = $lang_tag;
}
$document->addScript( $cf_url.'Locale.'.$tag.'.DatePicker.js' );
?>
It looks more complex that it is, most of the code is to get the language right.Bob
Thx a lot! It works! (After I realised that I had to change the language in the code😛 )
Hi Astrid,
You shouldn't need to change the language in the code :-( If you do then your site isn't setting the language to nl-NL
Bob
You shouldn't need to change the language in the code :-( If you do then your site isn't setting the language to nl-NL
Bob
Hi Greyhead,
Strange, that's the only way it works. Is it possible that it depends on the order of the actions or if they are set to controller or view?
I now have:
Custom code
Load JS
Show html
But tried with different orders as well. I mean this language code:
Changed:
to
Strange, that's the only way it works. Is it possible that it depends on the order of the actions or if they are set to controller or view?
I now have:
Custom code
Load JS
Show html
But tried with different orders as well. I mean this language code:
Changed:
$tag = 'en-US';
to
$tag = 'nl-NL';
This topic is locked and no more replies can be posted.