1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #27374 -- Made JavaScriptCatalog respect the packages argument.

This commit is contained in:
Alvin Lindstam
2016-10-22 19:20:24 -04:00
committed by Tim Graham
parent 9b9c8c4a81
commit 6b5106b1ce
3 changed files with 18 additions and 2 deletions

View File

@@ -356,7 +356,8 @@ class JavaScriptCatalog(View):
domain = kwargs.get('domain', self.domain)
# If packages are not provided, default to all installed packages, as
# DjangoTranslation without localedirs harvests them all.
packages = kwargs.get('packages', '').split('+') or self.packages
packages = kwargs.get('packages', '')
packages = packages.split('+') if packages else self.packages
paths = self.get_paths(packages) if packages else None
self.translation = DjangoTranslation(locale, domain=domain, localedirs=paths)
context = self.get_context_data(**kwargs)