1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

i18n: switched ngettext to make use of the standard ngettext instead simulating via gettext

git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@758 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Georg Bauer 2005-10-01 13:28:59 +00:00
parent 2c6e366f0a
commit 59052e48db

View File

@ -154,8 +154,15 @@ def ngettext(singular, plural, number):
This function returns the translation of either the singular This function returns the translation of either the singular
or plural, based on the number. or plural, based on the number.
""" """
if number == 1: return gettext(singular) global _default, _active
else: return gettext(plural)
t = _active.get(currentThread(), None)
if t is not None:
return t.ngettext(singular, plural, number)
if _default is None:
from django.conf import settings
_default = translation('*', settings.LANGUAGE_CODE)
return _default.ngettext(singular, plural, number)
def get_language_from_request(request): def get_language_from_request(request):
""" """