Changeset 3185

Show
Ignore:
Timestamp:
07/21/2008 11:45:16 PM (4 months ago)
Author:
Shadowhand
Message:

Follow up to r3184, comments and fixes for short English names.

Location:
trunk/system/libraries
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Calendar.php

    r3184 r3185  
    2222        protected $observed_data; 
    2323 
     24        /** 
     25         * Returns an array of the names of the days, using the current locale. 
     26         * 
     27         * @param   boolean  return short names 
     28         * @return  array 
     29         */ 
    2430        public static function days($short = FALSE) 
    2531        { 
     
    3036                $headings = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); 
    3137 
    32                 if (strpos(Kohana::config('locale.lang.0'), 'en') === FALSE) 
     38                if (strpos(Kohana::config('locale.language.0'), 'en') !== 0) 
    3339                { 
    3440                        // This is a bit awkward, but it works properly and is reliable 
     
    3743                                // Convert the English names to i18n names 
    3844                                $headings[$i] = strftime($format, strtotime($day)); 
     45                        } 
     46                } 
     47                elseif ($short == TRUE) 
     48                { 
     49                        foreach ($headings as $i => $day) 
     50                        { 
     51                                // Shorten the day names to 3 letters 
     52                                $headings[$i] = substr($day, 0, 3); 
    3953                        } 
    4054                } 
  • trunk/system/libraries/Image.php

    r3168 r3185  
    131131                if (isset($this->image[$property])) 
    132132                { 
    133                         return $this->image[$property];  
    134                 }                
     133                        return $this->image[$property]; 
     134                } 
    135135                else 
    136136                { 
    137137                        throw new Kohana_Exception('core.invalid_property', $column, get_class($this)); 
    138                 }                        
    139         } 
    140          
     138                } 
     139        } 
     140 
    141141        /** 
    142142         * Resize an image to a specific width and height. By default, Kohana will