Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 357868 Details for
Bug 482034
www-apps/trac-1.0.1 - migrate to distutils-r1.eclass
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
files/trac-1.0.1-changeset_11691.diff
trac-1.0.1-changeset_11691.diff (text/plain), 3.13 KB, created by
Bertrand Jacquin
on 2013-09-04 22:20:57 UTC
(
hide
)
Description:
files/trac-1.0.1-changeset_11691.diff
Filename:
MIME Type:
Creator:
Bertrand Jacquin
Created:
2013-09-04 22:20:57 UTC
Size:
3.13 KB
patch
obsolete
>------------------------------------------------------------------------ >r11691 | cboos | 2013-02-18 23:41:58 +0100 (Mon, 18 Feb 2013) | 15 lines > >1.0.2dev: second follow-up to r11689, no need for `check_catalog` param. > >`get_available_locales()` is defined in translation.py and clearly >states that it corresponds to the list of locale identifiers for which >//translations// are available. Which really means that checking for >the presence of the compiled catalog is always the right thing to do >(modulo the 'en_US' exception). > >The appropriate fix for `parse_date()` should have been to use the >list of locales for which we have //date localization information// >available, what the available translations are doesn't matter here. > >That list corresponds to what Babel provides, so we use now for that >`get_known_locales` (= `babel.localedata.list`). > > >Index: trac/util/datefmt.py >=================================================================== >--- trac/util/datefmt.py (revision 11690) >+++ trac/util/datefmt.py (revision 11691) >@@ -36,12 +36,16 @@ > get_time_format, get_month_names, > get_period_names, get_day_names > ) >+ from babel.localedata import list as get_known_locales >+ > except ImportError: > babel = None >+ def get_known_locales(): >+ return [] > > from trac.core import TracError > from trac.util.text import to_unicode, getpreferredencoding >-from trac.util.translation import _, ngettext, get_available_locales >+from trac.util.translation import _, ngettext > > # Date/time utilities > >@@ -534,8 +538,7 @@ > 'period_names': period_names, > } > >-_I18N_PARSE_DATE_PATTERNS = dict( >- (l, False) for l in get_available_locales(check_catalog=False)) >+_I18N_PARSE_DATE_PATTERNS = dict((l, False) for l in get_known_locales()) > > def _i18n_parse_date(text, tzinfo, locale): > locale = Locale.parse(locale) >Index: trac/util/translation.py >=================================================================== >--- trac/util/translation.py (revision 11690) >+++ trac/util/translation.py (revision 11691) >@@ -330,20 +330,16 @@ > def get_translations(): > return translations > >- def get_available_locales(check_catalog=True): >+ def get_available_locales(): > """Return a list of locale identifiers of the locales for which > translations are available. >- >- :param check_catalog: if `True` check for the compiled catalog >- (.mo), otherwise the presence of the >- directory is enough. > """ > try: > locales = [dirname for dirname > in pkg_resources.resource_listdir('trac', 'locale') > if '.' not in dirname >- and (not check_catalog or pkg_resources.resource_exists( >- 'trac', 'locale/%s/LC_MESSAGES/messages.mo' % dirname))] >+ and pkg_resources.resource_exists( >+ 'trac', 'locale/%s/LC_MESSAGES/messages.mo' % dirname)] > if 'en_US' not in locales: > locales.append('en_US') > return locales > >------------------------------------------------------------------------
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 482034
:
356648
|
356650
|
356652
|
357850
|
357858
|
357860
|
357862
|
357864
|
357866
| 357868 |
357870
|
357872
|
357874
|
357876
|
357878
|
357880
|
357882
|
357884
|
357886
|
357888
|
376934
|
377034
|
377036
|
377038