Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

New param array-localized_months for plugin html_select_date

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  

New param (array)localized_months for plugin html_select_date is?
Bad idea
0%
 0%  [ 0 ]
Can be useful
100%
 100%  [ 2 ]
English is only right way
0%
 0%  [ 0 ]
Total Votes : 2

Author Message
Mihor
Smarty n00b


Joined: 01 Jan 2007
Posts: 1
Location: Czech republic

PostPosted: Mon Jan 01, 2007 8:40 pm    Post subject: New param array-localized_months for plugin html_select_date Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Jan 02, 2007 8:17 am    Post subject: Reply with quote

you can use setlocale() and month_value_format to achieve localized month names in html_select_date.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP