Changeset 27944


Ignore:
Timestamp:
03/26/14 03:20:47 (10 years ago)
Author:
obi
Message:

fix translate date > day name

Location:
titan/titan
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/global.h

    r27943 r27944  
    20792079        else
    20802080                ret = strftime(buf, count, "%d-%m-%Y %H:%M", t);
    2081 
    2082         buf = string_replace("Mon", "Mon", buf, 1);
    2083         buf = string_replace("Tue", "Die", buf, 1);
    2084         buf = string_replace("Wed", "Mit", buf, 1);
    2085         buf = string_replace("Thu", "Don", buf, 1);
    2086         buf = string_replace("Fri", "Fre", buf, 1);
    2087         buf = string_replace("Sat", "Sam", buf, 1);
    2088         buf = string_replace("Sun", "Son", buf, 1);
    20892081
    20902082        return ret;
     
    66616653}
    66626654
     6655//flag 0: Mon > Montag
     6656//flag 1: Mon > Mon
     6657char* translate_time(char* input, int flag)
     6658{
     6659        char* tmpstr = NULL;
     6660        if(input == NULL) return tmpstr;
     6661        tmpstr = ostrcat(tmpstr, input, 1, 1); 
     6662
     6663        if(flag == 0)
     6664        {
     6665                tmpstr = string_replace_all("Wed", _("Wednesday"), tmpstr, 1);
     6666
     6667                tmpstr = string_replace_all("Mon", _("Monday"), tmpstr, 1);
     6668                tmpstr = string_replace_all("Tue", _("Tuesday"), tmpstr, 1);
     6669                tmpstr = string_replace_all("(Wed)", _("Wednesday"), tmpstr, 1);
     6670                tmpstr = string_replace_all("Thu", _("Thursday"), tmpstr, 1);
     6671                tmpstr = string_replace_all("Fri", _("Friday"), tmpstr, 1);
     6672                tmpstr = string_replace_all("Sat", _("Saturday"), tmpstr, 1);
     6673                tmpstr = string_replace_all("Sun", _("Sunday"), tmpstr, 1);
     6674        }
     6675        else
     6676        {       
     6677                tmpstr = string_replace("Mon", _("Mon"), tmpstr, 1);
     6678                tmpstr = string_replace("Tue", _("Tue"), tmpstr, 1);
     6679                tmpstr = string_replace("Wed", _("Wed"), tmpstr, 1);
     6680                tmpstr = string_replace("Thu", _("Thu"), tmpstr, 1);
     6681                tmpstr = string_replace("Fri", _("Fri"), tmpstr, 1);
     6682                tmpstr = string_replace("Sat", _("Sat"), tmpstr, 1);
     6683                tmpstr = string_replace("Sun", _("Sun"), tmpstr, 1);
     6684        }
     6685
     6686        return tmpstr;
     6687}
     6688
    66636689#endif
  • titan/titan/linkedchannel.h

    r23286 r27944  
    115115                                                                free(loctime); loctime = NULL;
    116116                                                                tmpstr = ostrcat(tmpstr, buf, 1, 0);
     117                                                                tmpstr = translate_time(tmpstr, 0);
    117118                                                        }
    118119                                                        tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
  • titan/titan/multiepg.h

    r23286 r27944  
    100100                                        ostrftime(buf, MINMALLOC, listbox->param2, loctime);
    101101                                        tmpstr = ostrcat(tmpstr, buf, 1, 0);
     102                                        tmpstr = translate_time(tmpstr, 0);
    102103                                        tmpstr = ostrcat(tmpstr, " - ", 1, 0);
    103104                                        tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
     105                                               
    104106                                        changetext2(chnode, tmpstr);
    105107                                        free(tmpstr); tmpstr = NULL;
     
    173175                                                ostrftime(buf, MINMALLOC, listbox->param1, loctime);
    174176                                                tmpstr = ostrcat(tmpstr, buf, 1, 0);
     177                                                tmpstr = translate_time(tmpstr, 1);
    175178
    176179                                                loctime = localtime(&epgnode->endtime);
    177180                                                ostrftime(buf, MINMALLOC, listbox->param2, loctime);
    178181                                                tmpstr = ostrcat(tmpstr, buf, 1, 0);
     182                                                tmpstr = translate_time(tmpstr, 1);
     183
    179184                                                tmpstr = ostrcat(tmpstr, " - ", 1, 0);
    180185                                                tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
     
    241246                                                ostrftime(buf, MINMALLOC, listbox->param2, loctime);
    242247                                                tmpstr = ostrcat(tmpstr, buf, 1, 0);
     248                                                tmpstr = translate_time(tmpstr, 0);
    243249                                                tmpstr = ostrcat(tmpstr, " - ", 1, 0);
    244250                                                tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
     
    308314                                                ostrftime(buf, MINMALLOC, listbox->param2, loctime);
    309315                                                tmpstr = ostrcat(tmpstr, buf, 1, 0);
     316                                                tmpstr = translate_time(tmpstr, 0);
    310317                                                tmpstr = ostrcat(tmpstr, " - ", 1, 0);
    311318                                                tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
     
    371378                                                ostrftime(buf, MINMALLOC, listbox->param2, loctime);
    372379                                                tmpstr = ostrcat(tmpstr, buf, 1, 0);
     380                                                tmpstr = translate_time(tmpstr, 0);
    373381                                                tmpstr = ostrcat(tmpstr, " - ", 1, 0);
    374382                                                tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
  • titan/titan/shortepg.h

    r18838 r27944  
    3333                ostrftime(buf, MINMALLOC, "%d.%m. (%a) %H:%M", loctime);
    3434                tmpstr = ostrcat(tmpstr, buf, 1, 0);
     35                tmpstr = translate_time(tmpstr, 0);
    3536                free(loctime); loctime = NULL;
    3637                tmpstr = ostrcat(tmpstr, "\n", 1, 0);
     
    3940                ostrftime(buf, MINMALLOC, "%d.%m. (%a) %H:%M", loctime);
    4041                tmpstr = ostrcat(tmpstr, buf, 1, 0);
     42                tmpstr = translate_time(tmpstr, 0);
     43
    4144                free(loctime); loctime = NULL;
    4245                tmpstr = ostrcat(tmpstr, "\n\n", 1, 0);
  • titan/titan/skinfunc.h

    r27941 r27944  
    506506                        buf1 = ostrcat(buf, NULL, 1, 0);
    507507
     508                        buf1 = translate_time(buf1, 0);
     509
    508510                        free(loctime); loctime = NULL;
    509511                        return buf1;
     
    721723        }
    722724
    723         buf1 = string_replace("Mon", "Montag", buf1, 1);
    724         buf1 = string_replace("Die", "Dienstag", buf1, 1);
    725         buf1 = string_replace("Mit", "Mittwoch", buf1, 1);
    726         buf1 = string_replace("Don", "Donnerstag", buf1, 1);
    727         buf1 = string_replace("Fre", "Freitag", buf1, 1);
    728         buf1 = string_replace("Sam", "Samstag", buf1, 1);
    729         buf1 = string_replace("Son", "Sonntag", buf1, 1);
     725        buf1 = translate_time(buf1, 1);
    730726
    731727        free(loctime);
Note: See TracChangeset for help on using the changeset viewer.