Fixed #25820 -- Allowed whitespace in admin's calendar.js month/weekday names.
This is useful for certain language translations.
This commit is contained in:
parent
717a54c883
commit
7f663aeccf
|
@ -1,4 +1,4 @@
|
|||
/*global gettext, get_format, quickElement, removeChildren*/
|
||||
/*global gettext, pgettext, get_format, quickElement, removeChildren*/
|
||||
/*
|
||||
calendar.js - Calendar functions by Adrian Holovaty
|
||||
depends on core.js for utility functions like removeChildren or quickElement
|
||||
|
@ -8,8 +8,29 @@ depends on core.js for utility functions like removeChildren or quickElement
|
|||
'use strict';
|
||||
// CalendarNamespace -- Provides a collection of HTML calendar-related helper functions
|
||||
var CalendarNamespace = {
|
||||
monthsOfYear: gettext('January February March April May June July August September October November December').split(' '),
|
||||
daysOfWeek: gettext('S M T W T F S').split(' '),
|
||||
monthsOfYear: [
|
||||
gettext('January'),
|
||||
gettext('February'),
|
||||
gettext('March'),
|
||||
gettext('April'),
|
||||
gettext('May'),
|
||||
gettext('June'),
|
||||
gettext('July'),
|
||||
gettext('August'),
|
||||
gettext('September'),
|
||||
gettext('October'),
|
||||
gettext('November'),
|
||||
gettext('December')
|
||||
],
|
||||
daysOfWeek: [
|
||||
pgettext('one letter Sunday', 'S'),
|
||||
pgettext('one letter Monday', 'M'),
|
||||
pgettext('one letter Tuesday', 'T'),
|
||||
pgettext('one letter Wednesday', 'W'),
|
||||
pgettext('one letter Thursday', 'T'),
|
||||
pgettext('one letter Friday', 'F'),
|
||||
pgettext('one letter Saturday', 'S')
|
||||
],
|
||||
firstDayOfWeek: parseInt(get_format('FIRST_DAY_OF_WEEK')),
|
||||
isLeapYear: function(year) {
|
||||
return (((year % 4) === 0) && ((year % 100) !== 0 ) || ((year % 400) === 0));
|
||||
|
|
|
@ -777,8 +777,8 @@ class DateTimePickerSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDriv
|
|||
# Enter test data
|
||||
member = models.Member.objects.create(name='Bob', birthdate=datetime(1984, 5, 15), gender='M')
|
||||
|
||||
# Get month names translations for every locales
|
||||
month_string = 'January February March April May June July August September October November December'
|
||||
# Get month name translations for every locale
|
||||
month_string = 'May'
|
||||
path = os.path.join(os.path.dirname(import_module('django.contrib.admin').__file__), 'locale')
|
||||
for language_code, language_name in settings.LANGUAGES:
|
||||
try:
|
||||
|
@ -786,12 +786,12 @@ class DateTimePickerSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDriv
|
|||
except IOError:
|
||||
continue
|
||||
if month_string in catalog._catalog:
|
||||
month_names = catalog._catalog[month_string]
|
||||
month_name = catalog._catalog[month_string]
|
||||
else:
|
||||
month_names = month_string
|
||||
month_name = month_string
|
||||
|
||||
# Get the expected caption
|
||||
may_translation = month_names.split(' ')[4]
|
||||
may_translation = month_name
|
||||
expected_caption = '{0:s} {1:d}'.format(may_translation.upper(), 1984)
|
||||
|
||||
# Test with every locale
|
||||
|
|
Loading…
Reference in New Issue