

(function(globals) {

  var django = globals.django || (globals.django = {});

  
  django.pluralidx = function(n) {
    var v=0;
    if (typeof(v) == 'boolean') {
      return v ? 1 : 0;
    } else {
      return v;
    }
  };
  

  /* gettext library */

  django.catalog = django.catalog || {};
  
  var newcatalog = {
    "Add to cart form field label\u0004Quantity": "\u5eab\u5b58",
    "Datepicker month\u0004April": "\u56db\u6708",
    "Datepicker month\u0004August": "\u516b\u6708",
    "Datepicker month\u0004December": "\u5341\u4e8c\u6708",
    "Datepicker month\u0004February": "\u4e8c\u6708",
    "Datepicker month\u0004January": "\u4e00\u6708",
    "Datepicker month\u0004July": "\u4e03\u6708",
    "Datepicker month\u0004June": "\u516d\u6708",
    "Datepicker month\u0004March": "\u4e09\u6708",
    "Datepicker month\u0004May": "\u4e94\u6708",
    "Datepicker month\u0004November": "\u5341\u4e00\u6708",
    "Datepicker month\u0004October": "\u5341\u6708",
    "Datepicker month\u0004September": "\u4e5d\u6708",
    "Datepicker month shortcut\u0004Apr": "\u56db\u6708",
    "Datepicker month shortcut\u0004Aug": "\u516b\u6708",
    "Datepicker month shortcut\u0004Dec": "\u5341\u4e8c\u6708",
    "Datepicker month shortcut\u0004Feb": "\u4e8c\u6708",
    "Datepicker month shortcut\u0004Jan": "\u4e00\u6708",
    "Datepicker month shortcut\u0004Jul": "\u4e03\u6708",
    "Datepicker month shortcut\u0004Jun": "\u516d\u6708",
    "Datepicker month shortcut\u0004Mar": "\u4e09\u6708",
    "Datepicker month shortcut\u0004May": "\u4e94\u6708",
    "Datepicker month shortcut\u0004Nov": "\u5341\u4e00\u6708",
    "Datepicker month shortcut\u0004Oct": "\u5341\u6708",
    "Datepicker month shortcut\u0004Sep": "\u4e5d\u6708",
    "Datepicker option\u0004Clear": "\u6e05\u7a7a",
    "Datepicker option\u0004Close": "\u95dc\u9589",
    "Datepicker option\u0004Next month": "\u4e0b\u500b\u6708",
    "Datepicker option\u0004Previous month": "\u4e0a\u500b\u6708",
    "Datepicker option\u0004Select a month": "\u9078\u64c7\u6708\u4efd",
    "Datepicker option\u0004Select a year": "\u9078\u64c7\u5e74\u4efd",
    "Datepicker option\u0004Today": "\u4eca\u5929",
    "Datepicker weekday\u0004Friday": "\u661f\u671f\u4e94",
    "Datepicker weekday\u0004Monday": "\u661f\u671f\u4e00",
    "Datepicker weekday\u0004Saturday": "\u661f\u671f\u516d",
    "Datepicker weekday\u0004Sunday": "\u661f\u671f\u65e5",
    "Datepicker weekday\u0004Thursday": "\u661f\u671f\u56db",
    "Datepicker weekday\u0004Tuesday": "\u661f\u671f\u4e8c",
    "Datepicker weekday\u0004Wednesday": "\u661f\u671f\u4e09",
    "Datepicker weekday shortcut\u0004Fri": "\u661f\u671f\u4e94",
    "Datepicker weekday shortcut\u0004Mon": "\u661f\u671f\u4e00",
    "Datepicker weekday shortcut\u0004Sat": "\u661f\u671f\u516d",
    "Datepicker weekday shortcut\u0004Sun": "\u661f\u671f\u65e5",
    "Datepicker weekday shortcut\u0004Thu": "\u661f\u671f\u56db",
    "Datepicker weekday shortcut\u0004Tue": "\u661f\u671f\u4e8c",
    "Datepicker weekday shortcut\u0004Wed": "\u661f\u671f\u4e09",
    "Friday shortcut\u0004F": "\u661f\u671f\u4e94",
    "Monday shortcut\u0004M": "\u661f\u671f\u4e00",
    "Product details primary action\u0004Add to cart": "\u52a0\u5230\u8cfc\u7269\u8eca",
    "Saturday shortcut\u0004S": "\u661f\u671f\u65e5",
    "Sunday shortcut\u0004S": "\u661f\u671f\u65e5",
    "Thursday shortcut\u0004T": "\u661f\u671f\u56db",
    "Tuesday shortcut\u0004T": "\u661f\u671f\u4e8c",
    "Wednesday shortcut\u0004W": "\u661f\u671f\u4e09",
    "item selected": [
      "\u5df2\u9078\u64c7"
    ]
  };
  for (var key in newcatalog) {
    django.catalog[key] = newcatalog[key];
  }
  

  if (!django.jsi18n_initialized) {
    django.gettext = function(msgid) {
      var value = django.catalog[msgid];
      if (typeof(value) == 'undefined') {
        return msgid;
      } else {
        return (typeof(value) == 'string') ? value : value[0];
      }
    };

    django.ngettext = function(singular, plural, count) {
      var value = django.catalog[singular];
      if (typeof(value) == 'undefined') {
        return (count == 1) ? singular : plural;
      } else {
        return value.constructor === Array ? value[django.pluralidx(count)] : value;
      }
    };

    django.gettext_noop = function(msgid) { return msgid; };

    django.pgettext = function(context, msgid) {
      var value = django.gettext(context + '\x04' + msgid);
      if (value.indexOf('\x04') != -1) {
        value = msgid;
      }
      return value;
    };

    django.npgettext = function(context, singular, plural, count) {
      var value = django.ngettext(context + '\x04' + singular, context + '\x04' + plural, count);
      if (value.indexOf('\x04') != -1) {
        value = django.ngettext(singular, plural, count);
      }
      return value;
    };

    django.interpolate = function(fmt, obj, named) {
      if (named) {
        return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
      } else {
        return fmt.replace(/%s/g, function(match){return String(obj.shift())});
      }
    };


    /* formatting library */

    django.formats = {
    "DATETIME_FORMAT": "Y\u5e74n\u6708j\u65e5 H:i",
    "DATETIME_INPUT_FORMATS": [
      "%Y/%m/%d %H:%M",
      "%Y-%m-%d %H:%M",
      "%Y\u5e74%n\u6708%j\u65e5 %H:%M",
      "%Y/%m/%d %H:%M:%S",
      "%Y-%m-%d %H:%M:%S",
      "%Y\u5e74%n\u6708%j\u65e5 %H:%M:%S",
      "%Y/%m/%d %H:%M:%S.%f",
      "%Y-%m-%d %H:%M:%S.%f",
      "%Y\u5e74%n\u6708%j\u65e5 %H:%n:%S.%f",
      "%Y-%m-%d"
    ],
    "DATE_FORMAT": "Y\u5e74n\u6708j\u65e5",
    "DATE_INPUT_FORMATS": [
      "%Y/%m/%d",
      "%Y-%m-%d",
      "%Y\u5e74%n\u6708%j\u65e5"
    ],
    "DECIMAL_SEPARATOR": ".",
    "FIRST_DAY_OF_WEEK": 1,
    "MONTH_DAY_FORMAT": "m\u6708j\u65e5",
    "NUMBER_GROUPING": 4,
    "SHORT_DATETIME_FORMAT": "Y\u5e74n\u6708j\u65e5 H:i",
    "SHORT_DATE_FORMAT": "Y\u5e74n\u6708j\u65e5",
    "THOUSAND_SEPARATOR": "",
    "TIME_FORMAT": "H:i",
    "TIME_INPUT_FORMATS": [
      "%H:%M",
      "%H:%M:%S",
      "%H:%M:%S.%f"
    ],
    "YEAR_MONTH_FORMAT": "Y\u5e74n\u6708"
  };

    django.get_format = function(format_type) {
      var value = django.formats[format_type];
      if (typeof(value) == 'undefined') {
        return format_type;
      } else {
        return value;
      }
    };

    /* add to global namespace */
    globals.pluralidx = django.pluralidx;
    globals.gettext = django.gettext;
    globals.ngettext = django.ngettext;
    globals.gettext_noop = django.gettext_noop;
    globals.pgettext = django.pgettext;
    globals.npgettext = django.npgettext;
    globals.interpolate = django.interpolate;
    globals.get_format = django.get_format;

    django.jsi18n_initialized = true;
  }

}(this));

