Ticket #7068: 7068.diff

File 7068.diff, 1.4 KB (added by Joe Ripley <vitaminjoe@…>, 15 years ago)

Fix day name translation

  • trunk/mythplugins/mythweb/modules/weather/classes/WeatherScreen.php

     
    282282    // Populate data array
    283283        while($dataitem = $sh->fetch_col())
    284284            $this->data[$dataitem] = $output_array[$dataitem];
     285
     286    // Convert day numbers to text, if necessary
     287        foreach (array_keys($this->data) as $key) {
     288            if (strpos($key, 'date-') !== false) {
     289                if (is_numeric($this->data[$key])) {
     290                    switch ($this->data[$key]) {
     291                        case 0: $this->data[$key] = t('Sunday');    break;
     292                        case 1: $this->data[$key] = t('Monday');    break;
     293                        case 2: $this->data[$key] = t('Tuesday');   break;
     294                        case 3: $this->data[$key] = t('Wednesday'); break;
     295                        case 4: $this->data[$key] = t('Thursday');  break;
     296                        case 5: $this->data[$key] = t('Friday');    break;
     297                        case 6: $this->data[$key] = t('Satday');    break;
     298                    }
     299                }
     300            }
     301        }
     302   
    285303    }
    286304
    287305    function runScript( $script, $args ) {