Use the new activate() to pull in the AMO .mo files and use the new _() everywhere else
This commit is contained in:
Родитель
c9d1aff4bc
Коммит
e220a4b999
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
Miscellaneous helpers that make Django compatible with AMO.
|
||||
"""
|
||||
from django.utils.translation import ugettext as _
|
||||
from l10n import ugettext as _
|
||||
|
||||
|
||||
class cached_property(object):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.conf import settings
|
||||
from django.utils import translation
|
||||
from django.utils.translation import ugettext as _
|
||||
from l10n import ugettext as _
|
||||
from django.utils.http import urlquote
|
||||
|
||||
import amo
|
||||
|
|
|
@ -5,7 +5,7 @@ import urllib
|
|||
import urlparse
|
||||
|
||||
from django.utils import translation
|
||||
from django.utils.translation import ugettext as _
|
||||
from l10n import ugettext as _
|
||||
|
||||
from babel import Locale
|
||||
from babel.support import Format
|
||||
|
|
|
@ -4,9 +4,10 @@ Borrowed from: http://code.google.com/p/django-localeurl
|
|||
Note: didn't make sense to use localeurl since we need to capture app as well
|
||||
"""
|
||||
from django.http import HttpResponsePermanentRedirect
|
||||
from django.utils import translation
|
||||
from django.utils.encoding import smart_str
|
||||
|
||||
from lib import l10n
|
||||
|
||||
import amo.models
|
||||
from . import urlresolvers
|
||||
from .helpers import urlparams
|
||||
|
@ -51,5 +52,5 @@ class LocaleAndAppURLMiddleware(object):
|
|||
return response
|
||||
|
||||
request.path_info = '/' + prefixer.shortened_path
|
||||
translation.activate(prefixer.locale)
|
||||
l10n.activate(prefixer.locale)
|
||||
request.APP = amo.APPS.get(prefixer.app)
|
||||
|
|
|
@ -7,7 +7,7 @@ import datetime
|
|||
|
||||
from django.http import HttpResponse, HttpResponsePermanentRedirect
|
||||
from django.utils import translation
|
||||
from django.utils.translation import ugettext as _
|
||||
from l10n import ugettext as _
|
||||
|
||||
import jingo
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import collections
|
||||
import itertools
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
from l10n import ugettext as _
|
||||
|
||||
import jingo
|
||||
import product_details
|
||||
|
|
|
@ -3,7 +3,7 @@ import urllib
|
|||
import urlparse
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _, ungettext
|
||||
from l10n import ugettext as _, ungettext
|
||||
|
||||
import jinja2
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ from django.core.urlresolvers import reverse
|
|||
from django.contrib.auth.models import User as DjangoUser
|
||||
from django.db import models
|
||||
|
||||
import amo
|
||||
import amo.models
|
||||
from translations.fields import TranslatedField
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ from django.core.management.base import BaseCommand
|
|||
|
||||
from jinja2 import ext
|
||||
|
||||
from lib.l10n import strip_whitespace
|
||||
from l10n import strip_whitespace
|
||||
|
||||
DEFAULT_DOMAIN = 'messages'
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче