

(function (globals) {

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

  
  django.pluralidx = function (count) { return (count == 1) ? 0 : 1; };
  

  
  /* gettext library */

  django.catalog = {
    "%(start_link)sSign in%(end_link)s to insert your credentials.": "%(start_link)sSign in%(end_link)s to insert your credentials.", 
    "<b>Note:</b> For security, this credential can only be displayed in the Google API Console. You can copy and paste it from there.": "<b>Note:</b> For security, this credential can only be displayed in the Google API Console. You can copy and paste it from there.", 
    "Cancel": "\u53d6\u6d88", 
    "Click to insert your credentials": "\u70b9\u51fb\u5373\u53ef\u63d2\u5165\u60a8\u7684\u51ed\u636e", 
    "Credentials": "\u51ed\u636e", 
    "Insert": "\u63d2\u5165", 
    "Insert credential": "\u63d2\u5165\u51ed\u636e", 
    "Loading credentials...": "\u6b63\u5728\u52a0\u8f7d\u51ed\u636e\u2026", 
    "Loading projects...": "\u6b63\u5728\u52a0\u8f7d\u9879\u76ee\u2026", 
    "Project": "\u9879\u76ee", 
    "Sorry. We couldn't load the credentials for this project. You can visit the %(start_link)sDevelopers Console%(end_link)s to see them.": "Sorry. We couldn't load the credentials for this project. You can visit the %(start_link)sDevelopers Console%(end_link)s to see them.", 
    "Sorry. We couldn't load your projects. You can visit the %(start_link)sDevelopers Console%(end_link)s to see them.": "Sorry. We couldn't load your projects. You can visit the %(start_link)sDevelopers Console%(end_link)s to see them.", 
    "This project has no appropriate credentials. You can add one in the %(start_link)sDevelopers Console%(end_link)s.": "This project has no appropriate credentials. You can add one in the %(start_link)sDevelopers Console%(end_link)s.", 
    "View": "\u67e5\u770b", 
    "You have no projects. You can create one in the %(start_link)sDevelopers Console%(end_link)s.": "You have no projects. You can create one in the %(start_link)sDevelopers Console%(end_link)s."
  };

  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[django.pluralidx(count)];
    }
  };

  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;

}(this));

