Ticket #1061: 1061.diff

File 1061.diff, 1.6 KB (added by Marc Garcia, 16 years ago)

Fix and example of how djangojs.po files should be updated to work on every language

  • django/contrib/admin/media/js/calendar.js

     
    2525var CalendarNamespace = {
    2626    monthsOfYear: gettext('January February March April May June July August September October November December').split(' '),
    2727    daysOfWeek: gettext('S M T W T F S').split(' '),
     28    firstDayOfWeek: parseInt(gettext('FIRST_DAY_OF_WEEK').replace('FIRST_DAY_OF_WEEK', '0')),
    2829    isLeapYear: function(year) {
    2930        return (((year % 4)==0) && ((year % 100)!=0) || ((year % 400)==0));
    3031    },
     
    5657        // Draw days-of-week header
    5758        var tableRow = quickElement('tr', tableBody);
    5859        for (var i = 0; i < 7; i++) {
    59             quickElement('th', tableRow, CalendarNamespace.daysOfWeek[i]);
     60            quickElement('th', tableRow, CalendarNamespace.daysOfWeek[(i + CalendarNamespace.firstDayOfWeek) % 7]);
    6061        }
    6162
    6263        var startingPos = new Date(year, month-1, 1).getDay();
  • django/conf/locale/ca/LC_MESSAGES/djangojs.po

     
    5757msgid "S M T W T F S"
    5858msgstr "Dg Dl Dt Dc Dj Dv Ds"
    5959
     60#: contrib/admin/media/js/calendar.js:26
     61msgid "FIRST_DAY_OF_WEEK"
     62msgstr "1"
     63
    6064#: contrib/admin/media/js/admin/DateTimeShortcuts.js:47
    6165#: contrib/admin/media/js/admin/DateTimeShortcuts.js:81
    6266msgid "Now"
Back to Top