lower case en-US (bug 615703)
This commit is contained in:
Родитель
a2b87d062a
Коммит
eebcc18d1b
|
@ -1355,26 +1355,21 @@ class TestEdit(test_utils.TestCase):
|
|||
return [reverse(p, args=[id]) for p in paths]
|
||||
|
||||
def test_l10n(self):
|
||||
Addon.objects.get(id=3615).update(default_locale='en-US')
|
||||
for url in self.get_l10n_urls():
|
||||
r = self.client.get(url)
|
||||
doc = pq(r.content)
|
||||
eq_(doc('#l10n-menu').attr('data-default'), 'en-US')
|
||||
eq_(doc('#l10n-menu').attr('data-default'), 'en-us')
|
||||
|
||||
def test_l10n_not_us(self):
|
||||
addon = Addon.objects.get(id=3615)
|
||||
addon.default_locale = "fr"
|
||||
addon.save()
|
||||
|
||||
Addon.objects.get(id=3615).update(default_locale='fr')
|
||||
for url in self.get_l10n_urls():
|
||||
r = self.client.get(url)
|
||||
doc = pq(r.content)
|
||||
eq_(doc('#l10n-menu').attr('data-default'), 'fr')
|
||||
|
||||
def test_l10n_not_us_id_url(self):
|
||||
addon = Addon.objects.get(id=3615)
|
||||
addon.default_locale = "fr"
|
||||
addon.save()
|
||||
|
||||
Addon.objects.get(id=3615).update(default_locale='fr')
|
||||
for url in self.get_l10n_urls():
|
||||
url = '/id' + url[6:]
|
||||
r = self.client.get(url)
|
||||
|
|
|
@ -40,8 +40,8 @@ def truncate(s, length=255, killwords=False, end='...'):
|
|||
@jinja2.contextfunction
|
||||
def l10n_menu(context, default_locale='en-us'):
|
||||
"""Generates the locale menu for zamboni l10n."""
|
||||
default_locale = default_locale.lower()
|
||||
languages = dict((i.lower(), j) for i, j in settings.LANGUAGES.items())
|
||||
c = dict(context.items())
|
||||
c.update(locals())
|
||||
c.update({'languages': languages, 'default_locale': default_locale})
|
||||
return c
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче