django/django — pull request #13 by matthewwithanm (2012-04-28 19:48:21+00:00)
Title: i18n javascript_catalog View Pollutes Global Namespace

This pull request corresponds to [Trac Ticket number 18231][0]

> In addition to the translation functions (`gettext`, `ngettext`, etc.), the global variables catalog and formats are created. These variables are required to exist and be in the correct format in order for the translation functions to work.
>
> Seeing as how these are common words, with a relatively high likelihood of being clobbered, I propose we use the module pattern (an immediately invoked function).
>
> This patch also uses vanilla objects for `catalog` and `formats` as those are the preferred type for dictionaries in JavaScript.

[0]:https://code.djangoproject.com/ticket/18231