|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
New param (array)localized_months for plugin html_select_date is? |
Bad idea |
|
0% |
[ 0 ] |
Can be useful |
|
100% |
[ 2 ] |
English is only right way |
|
0% |
[ 0 ] |
|
Total Votes : 2 |
|
Author |
Message |
Mihor Smarty n00b
Joined: 01 Jan 2007 Posts: 1 Location: Czech republic
|
Posted: Mon Jan 01, 2007 8:40 pm Post subject: New param array-localized_months for plugin html_select_date |
|
|
Hi
I think that few new rows of source code can help many people, who are writing multilanguage projects.
Code: |
~
foreach ($params as $_key=>$_value) {
switch ($_key) {
case 'prefix':
case 'time':
case 'start_year':
~
<newCase>
case 'localized_months':
$$_key = is_array($_value) ? $_value : false;
break;
</newCase>
~
~
if ($display_months) {
$month_names = array();
$month_values = array();
if(isset($month_empty)) {
$month_names[''] = $month_empty;
$month_values[''] = '';
}
<newArrayLink>
if (is_array($localized_months)) {
$month_names = &$localized_months;
}
</newArrayLink>
for($i = 1; $i <= 12; $i++) {
$month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
<newIf>
if (!is_array($localized_months)) {
</newIf>
$month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
<newEndIf>
}
</newEndIf>
}
~
|
Please integrate this in new version.
I know plugin html_options but I think that way is better. Thanks much for reading and...
certainly thanks all for voting.
Better days in new year to everyone. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Jan 02, 2007 8:17 am Post subject: |
|
|
you can use setlocale() and month_value_format to achieve localized month names in html_select_date. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|