Lines 26-31
Link Here
|
26 |
|
26 |
|
27 |
try: |
27 |
try: |
28 |
import babel |
28 |
import babel |
|
|
29 |
except ImportError: |
30 |
babel = None |
31 |
def get_known_locales(): |
32 |
return [] |
33 |
else: |
29 |
from babel import Locale |
34 |
from babel import Locale |
30 |
from babel.core import LOCALE_ALIASES |
35 |
from babel.core import LOCALE_ALIASES |
31 |
from babel.dates import ( |
36 |
from babel.dates import ( |
Lines 36-48
Link Here
|
36 |
get_time_format, get_month_names, |
41 |
get_time_format, get_month_names, |
37 |
get_period_names, get_day_names |
42 |
get_period_names, get_day_names |
38 |
) |
43 |
) |
39 |
from babel.localedata import list as get_known_locales |
44 |
try: |
|
|
45 |
from babel.localedata import list as get_known_locales |
46 |
except ImportError: |
47 |
from babel.localedata import locale_identifiers as get_known_locales |
40 |
|
48 |
|
41 |
except ImportError: |
|
|
42 |
babel = None |
43 |
def get_known_locales(): |
44 |
return [] |
45 |
|
46 |
from trac.core import TracError |
49 |
from trac.core import TracError |
47 |
from trac.util.text import to_unicode, getpreferredencoding |
50 |
from trac.util.text import to_unicode, getpreferredencoding |
48 |
from trac.util.translation import _, ngettext |
51 |
from trac.util.translation import _, ngettext |
49 |
----------------------------------------------------------------------- |
|
|