Lines 36-47
Link Here
|
36 |
get_time_format, get_month_names, |
36 |
get_time_format, get_month_names, |
37 |
get_period_names, get_day_names |
37 |
get_period_names, get_day_names |
38 |
) |
38 |
) |
|
|
39 |
from babel.localedata import list as get_known_locales |
40 |
|
39 |
except ImportError: |
41 |
except ImportError: |
40 |
babel = None |
42 |
babel = None |
|
|
43 |
def get_known_locales(): |
44 |
return [] |
41 |
|
45 |
|
42 |
from trac.core import TracError |
46 |
from trac.core import TracError |
43 |
from trac.util.text import to_unicode, getpreferredencoding |
47 |
from trac.util.text import to_unicode, getpreferredencoding |
44 |
from trac.util.translation import _, ngettext, get_available_locales |
48 |
from trac.util.translation import _, ngettext |
45 |
|
49 |
|
46 |
# Date/time utilities |
50 |
# Date/time utilities |
47 |
|
51 |
|
Lines 534-541
Link Here
|
534 |
'period_names': period_names, |
538 |
'period_names': period_names, |
535 |
} |
539 |
} |
536 |
|
540 |
|
537 |
_I18N_PARSE_DATE_PATTERNS = dict( |
541 |
_I18N_PARSE_DATE_PATTERNS = dict((l, False) for l in get_known_locales()) |
538 |
(l, False) for l in get_available_locales(check_catalog=False)) |
|
|
539 |
|
542 |
|
540 |
def _i18n_parse_date(text, tzinfo, locale): |
543 |
def _i18n_parse_date(text, tzinfo, locale): |
541 |
locale = Locale.parse(locale) |
544 |
locale = Locale.parse(locale) |