Skip to content

Loading…

catalog, formats should not be arrays in JS #432

Closed
wants to merge 1 commit into from

3 participants

@arild-haugstad

catalog and formats are used as dictionaries, i.e. JavaScript objects,
and using arrays when no array-specific properties are used adds
unnecessary confusion

@arild-haugstad arild-haugstad catalog, formats should not be arrays in JS
catalog and formats are used as dictionaries, i.e. JavaScript objects,
and using arrays when no array-specific properties are used adds
unnecessary confusion
2a7e84d
@aaugustin
Django member

This patch looks good to me.

@timgraham
Django member

Looks like the code has been refactored.

@timgraham timgraham closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 7, 2012
  1. @arild-haugstad

    catalog, formats should not be arrays in JS

    arild-haugstad committed
    catalog and formats are used as dictionaries, i.e. JavaScript objects,
    and using arrays when no array-specific properties are used adds
    unnecessary confusion
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/views/i18n.py
View
4 django/views/i18n.py
@@ -73,7 +73,7 @@ def get_formats():
LibHead = """
/* gettext library */
-var catalog = new Array();
+var catalog = {};
"""
LibFoot = """
@@ -118,7 +118,7 @@ def get_formats():
LibFormatHead = """
/* formatting library */
-var formats = new Array();
+var formats = {};
"""
Something went wrong with that request. Please try again.