diff options
author | clsung <clsung@FreeBSD.org> | 2010-12-31 09:37:40 +0800 |
---|---|---|
committer | clsung <clsung@FreeBSD.org> | 2010-12-31 09:37:40 +0800 |
commit | 909beadefc0b05501f915498389e1c10e99925c5 (patch) | |
tree | b90eed084e38e2aa645bdbc2454c5c3a39d8d4fe /www/trac | |
parent | 86a5d80bfe8bccc9b866c171b357e5be1b38bf9f (diff) | |
download | freebsd-ports-gnome-909beadefc0b05501f915498389e1c10e99925c5.tar.gz freebsd-ports-gnome-909beadefc0b05501f915498389e1c10e99925c5.tar.zst freebsd-ports-gnome-909beadefc0b05501f915498389e1c10e99925c5.zip |
- Update to 0.12.1
PR: ports/153368
Submitted by: Dmitry <dmitry2006_AT_yandex dot ru>
Diffstat (limited to 'www/trac')
-rw-r--r-- | www/trac/Makefile | 3 | ||||
-rw-r--r-- | www/trac/distinfo | 5 | ||||
-rw-r--r-- | www/trac/files/patch-trac__util__translation.py | 35 | ||||
-rw-r--r-- | www/trac/files/patch-trac__web__main.py | 58 |
4 files changed, 3 insertions, 98 deletions
diff --git a/www/trac/Makefile b/www/trac/Makefile index e244cb5e64fb..660d3c422924 100644 --- a/www/trac/Makefile +++ b/www/trac/Makefile @@ -6,8 +6,7 @@ # PORTNAME= trac -PORTVERSION= 0.12 -PORTREVISION= 1 +PORTVERSION= 0.12.1 CATEGORIES= www devel python MASTER_SITES= http://ftp.edgewall.com/pub/trac/ \ ftp://ftp.edgewall.com/pub/trac/ diff --git a/www/trac/distinfo b/www/trac/distinfo index 9a97b41f1f68..ef2caf54e789 100644 --- a/www/trac/distinfo +++ b/www/trac/distinfo @@ -1,3 +1,2 @@ -MD5 (Trac-0.12.tar.gz) = 3e8fabbaf8fe889e9c03a7dff09d5d05 -SHA256 (Trac-0.12.tar.gz) = a1c15c0c3a0c717e6d50d4e4f949b8e8c510a308611013c45c6253c675e805cf -SIZE (Trac-0.12.tar.gz) = 2107428 +SHA256 (Trac-0.12.1.tar.gz) = 7ab452a99e61be9cc6b6fd7dbcfa6e4f5d1760480a132dc41c6fe2fce10c73a4 +SIZE (Trac-0.12.1.tar.gz) = 2170563 diff --git a/www/trac/files/patch-trac__util__translation.py b/www/trac/files/patch-trac__util__translation.py deleted file mode 100644 index 70d974b3eef7..000000000000 --- a/www/trac/files/patch-trac__util__translation.py +++ /dev/null @@ -1,35 +0,0 @@ ---- ./trac/util/translation.py.orig 2010-06-13 20:36:24.000000000 +0000 -+++ ./trac/util/translation.py 2010-10-12 06:14:47.021523796 +0000 -@@ -101,8 +101,10 @@ - def dungettext(self, domain, singular, plural, num): - return self.ungettext(singular, plural, num) - -+has_babel = False - - try: -+ from babel import Locale - from babel.support import LazyProxy, Translations - - class TranslationsProxy(object): -@@ -329,6 +331,14 @@ - in pkg_resources.resource_listdir('trac', 'locale') - if '.' not in dirname] - -+ def get_negotiated_locale(preferred_locales): -+ def normalize(locale_ids): -+ return [id.replace('_', '-') for id in locale_ids if id] -+ return Locale.negotiate(normalize(preferred_locales), -+ normalize(get_available_locales()), sep='-') -+ -+ has_babel = True -+ - except ImportError: # fall back on 0.11 behavior, i18n functions are no-ops - gettext = _ = gettext_noop - dgettext = dgettext_noop -@@ -358,3 +368,6 @@ - - def get_available_locales(): - return [] -+ -+ def get_negotiated_locale(preferred=None, default=None): -+ return None diff --git a/www/trac/files/patch-trac__web__main.py b/www/trac/files/patch-trac__web__main.py deleted file mode 100644 index c04bbed3e58d..000000000000 --- a/www/trac/files/patch-trac__web__main.py +++ /dev/null @@ -1,58 +0,0 @@ ---- ./trac/web/main.py.orig 2010-06-13 20:36:24.000000000 +0000 -+++ ./trac/web/main.py 2010-10-12 06:14:47.022524485 +0000 -@@ -26,10 +26,6 @@ - from pprint import pformat, pprint - import sys - --try: -- from babel import Locale --except ImportError: -- Locale = None - from genshi.core import Markup - from genshi.builder import Fragment, tag - from genshi.output import DocType -@@ -48,7 +44,8 @@ - from trac.util.concurrency import threading - from trac.util.datefmt import format_datetime, http_date, localtz, timezone - from trac.util.text import exception_to_unicode, shorten_line, to_unicode --from trac.util.translation import safefmt, tag_, _ -+from trac.util.translation import _, get_negotiated_locale, has_babel, \ -+ safefmt, tag_ - from trac.web.api import * - from trac.web.chrome import Chrome - from trac.web.clearsilver import HDFWrapper -@@ -150,6 +147,11 @@ - default_timezone = Option('trac', 'default_timezone', '', - """The default timezone to use""") - -+ default_language = Option('trac', 'default_language', '', -+ """The preferred language to use if no user preference has been set. -+ (''since 0.12.1'') -+ """) -+ - # Public API - - def authenticate(self, req): -@@ -302,16 +304,12 @@ - return FakeSession() - - def _get_locale(self, req): -- if Locale: -- available = [locale_id.replace('_', '-') for locale_id in -- translation.get_available_locales()] -- -- preferred = req.session.get('language', req.languages) -- if not isinstance(preferred, list): -- preferred = [preferred] -- negotiated = Locale.negotiate(preferred, available, sep='-') -- self.log.debug("Negotiated locale: %s -> %s", -- preferred, negotiated) -+ if has_babel: -+ preferred = req.session.get('language') -+ default = self.env.config.get('trac', 'default_language', '') -+ negotiated = get_negotiated_locale([preferred, default] + -+ req.languages) -+ self.log.debug("Negotiated locale: %s -> %s", preferred, negotiated) - return negotiated - - def _get_timezone(self, req): |