client/assets/libs/jed.js
function ( domain, context, singular_key, plural_key, val ) {
      // Set some defaults

      plural_key = plural_key || singular_key;

      // Use the global domain default if one
      // isn't explicitly passed in
      domain = domain || this._textdomain;

      var fallback;

      // Handle special cases

      // No options found
      if ( ! this.options ) {
        // There's likely something wrong, but we'll return the correct key for english
        // We do this by instantiating a brand new Jed instance with the default set
        // for everything that could be broken.
        fallback = new Jed();
        return fallback.dcnpgettext.call( fallback, undefined, undefined, singular_key, plural_key, val );
      }

      // No translation data provided
      if ( ! this.options.locale_data ) {
        throw new Error('No locale data provided.');
      }

      if ( ! this.options.locale_data[ domain ] ) {
        throw new Error('Domain `' + domain + '` was not found.');
      }

      if ( ! this.options.locale_data[ domain ][ "" ] ) {
        throw new Error('No locale meta information provided.');
      }

      // Make sure we have a truthy key. Otherwise we might start looking
      // into the empty string key, which is the options for the locale
      // data.
      if ( ! singular_key ) {
        throw new Error('No translation key found.');
      }

      var key  = context ? context + Jed.context_delimiter + singular_key : singular_key,
          locale_data = this.options.locale_data,
          dict = locale_data[ domain ],
          defaultConf = (locale_data.messages || this.defaults.locale_data.messages)[""],
          pluralForms = dict[""].plural_forms || dict[""]["Plural-Forms"] || dict[""]["plural-forms"] || defaultConf.plural_forms || defaultConf["Plural-Forms"] || defaultConf["plural-forms"],
          val_list,
          res;

      var val_idx;
      if (val === undefined) {
        // No value passed in; assume singular key lookup.
        val_idx = 1;

      } else {
        // Value has been passed in; use plural-forms calculations.

        // Handle invalid numbers, but try casting strings for good measure
        if ( typeof val != 'number' ) {
          val = parseInt( val, 10 );

          if ( isNaN( val ) ) {
            throw new Error('The number that was passed in is not a number.');
          }
        }

        val_idx = getPluralFormFunc(pluralForms)(val) + 1;
      }

      // Throw an error if a domain isn't found
      if ( ! dict ) {
        throw new Error('No domain named `' + domain + '` could be found.');
      }

      val_list = dict[ key ];

      // If there is no match, then revert back to
      // english style singular/plural with the keys passed in.
      if ( ! val_list || val_idx >= val_list.length ) {
        if (this.options.missing_key_callback) {
          this.options.missing_key_callback(key, domain);
        }
        res = [ null, singular_key, plural_key ];

        // collect untranslated strings
        if (this.options.debug===true) {
          console.log(res[ getPluralFormFunc(pluralForms)( val ) + 1 ]);
        }
        return res[ getPluralFormFunc()( val ) + 1 ];
      }

      res = val_list[ val_idx ];

      // This includes empty strings on purpose
      if ( ! res  ) {
        res = [ null, singular_key, plural_key ];
        return res[ getPluralFormFunc()( val ) + 1 ];
      }
      return res;
    }
function ( domain, context, singular_key, plural_key, val ) {
      // Set some defaults

      plural_key = plural_key || singular_key;

      // Use the global domain default if one
      // isn't explicitly passed in
      domain = domain || this._textdomain;

      var fallback;

      // Handle special cases

      // No options found
      if ( ! this.options ) {
        // There's likely something wrong, but we'll return the correct key for english
        // We do this by instantiating a brand new Jed instance with the default set
        // for everything that could be broken.
        fallback = new Jed();
        return fallback.dcnpgettext.call( fallback, undefined, undefined, singular_key, plural_key, val );
      }

      // No translation data provided
      if ( ! this.options.locale_data ) {
        throw new Error('No locale data provided.');
      }

      if ( ! this.options.locale_data[ domain ] ) {
        throw new Error('Domain `' + domain + '` was not found.');
      }

      if ( ! this.options.locale_data[ domain ][ "" ] ) {
        throw new Error('No locale meta information provided.');
      }

      // Make sure we have a truthy key. Otherwise we might start looking
      // into the empty string key, which is the options for the locale
      // data.
      if ( ! singular_key ) {
        throw new Error('No translation key found.');
      }

      var key  = context ? context + Jed.context_delimiter + singular_key : singular_key,
          locale_data = this.options.locale_data,
          dict = locale_data[ domain ],
          defaultConf = (locale_data.messages || this.defaults.locale_data.messages)[""],
          pluralForms = dict[""].plural_forms || dict[""]["Plural-Forms"] || dict[""]["plural-forms"] || defaultConf.plural_forms || defaultConf["Plural-Forms"] || defaultConf["plural-forms"],
          val_list,
          res;

      var val_idx;
      if (val === undefined) {
        // No value passed in; assume singular key lookup.
        val_idx = 1;

      } else {
        // Value has been passed in; use plural-forms calculations.

        // Handle invalid numbers, but try casting strings for good measure
        if ( typeof val != 'number' ) {
          val = parseInt( val, 10 );

          if ( isNaN( val ) ) {
            throw new Error('The number that was passed in is not a number.');
          }
        }

        val_idx = getPluralFormFunc(pluralForms)(val) + 1;
      }

      // Throw an error if a domain isn't found
      if ( ! dict ) {
        throw new Error('No domain named `' + domain + '` could be found.');
      }

      val_list = dict[ key ];

      // If there is no match, then revert back to
      // english style singular/plural with the keys passed in.
      if ( ! val_list || val_idx >= val_list.length ) {
        if (this.options.missing_key_callback) {
          this.options.missing_key_callback(key, domain);
        }
        res = [ null, singular_key, plural_key ];

        // collect untranslated strings
        if (this.options.debug===true) {
          console.log(res[ getPluralFormFunc(pluralForms)( val ) + 1 ]);
        }
        return res[ getPluralFormFunc()( val ) + 1 ];
      }

      res = val_list[ val_idx ];

      // This includes empty strings on purpose
      if ( ! res  ) {
        res = [ null, singular_key, plural_key ];
        return res[ getPluralFormFunc()( val ) + 1 ];
      }
      return res;
    }
function ( domain , context , singular_key , plural_key , val ) { // Set some defaults
 plural_key = plural_key || singular_key ; // Use the global domain default if one
 // isn't explicitly passed in
 domain = domain || this . _textdomain ; var fallback ; // Handle special cases
 // No options found
 if ( ! this . options ) { // There's likely something wrong, but we'll return the correct key for english
 // We do this by instantiating a brand new Jed instance with the default set
 // for everything that could be broken.
 fallback = new Jed ( ) ; return fallback . dcnpgettext . call ( fallback , undefined , undefined , singular_key , plural_key , val ) ; } // No translation data provided
 if ( ! this . options . locale_data ) { throw new Error ( 'No locale data provided.' ) ; } if ( ! this . options . locale_data [ domain ] ) { throw new Error ( 'Domain `' + domain + '` was not found.' ) ; } if ( ! this . options . locale_data [ domain ] [ "" ] ) { throw new Error ( 'No locale meta information provided.' ) ; } // Make sure we have a truthy key. Otherwise we might start looking
 // into the empty string key, which is the options for the locale
 // data.
 if ( ! singular_key ) { throw new Error ( 'No translation key found.' ) ; } var key = context ? context + Jed . context_delimiter + singular_key : singular_key , locale_data = this . options . locale_data , dict = locale_data [ domain ] , defaultConf = ( locale_data . messages || this . defaults . locale_data . messages ) [ "" ] , pluralForms = dict [ "" ] . plural_forms || dict [ "" ] [ "Plural-Forms" ] || dict [ "" ] [ "plural-forms" ] || defaultConf . plural_forms || defaultConf [ "Plural-Forms" ] || defaultConf [ "plural-forms" ] , val_list , res ; var val_idx ; if ( val === undefined ) { // No value passed in; assume singular key lookup.
 val_idx = 1 ; } else { // Value has been passed in; use plural-forms calculations.
 // Handle invalid numbers, but try casting strings for good measure
 if ( typeof val != 'number' ) { val = parseInt ( val , 10 ) ; if ( isNaN ( val ) ) { throw new Error ( 'The number that was passed in is not a number.' ) ; } } val_idx = getPluralFormFunc ( pluralForms ) ( val ) + 1 ; } // Throw an error if a domain isn't found
 if ( ! dict ) { throw new Error ( 'No domain named `' + domain + '` could be found.' ) ; } val_list = dict [ key ] ; // If there is no match, then revert back to
 // english style singular/plural with the keys passed in.
 if ( ! val_list || val_idx >= val_list . length ) { if ( this . options . missing_key_callback ) { this . options . missing_key_callback ( key , domain ) ; } res = [ null , singular_key , plural_key ] ; // collect untranslated strings
 if ( this . options . debug === true ) { console . log ( res [ getPluralFormFunc ( pluralForms ) ( val ) + 1 ] ) ; } return res [ getPluralFormFunc ( ) ( val ) + 1 ] ; } res = val_list [ val_idx ] ; // This includes empty strings on purpose
 if ( ! res ) { res = [ null , singular_key , plural_key ] ; return res [ getPluralFormFunc ( ) ( val ) + 1 ] ; } return res ; }
The most fully qualified gettext function. It has every option. Since it has every option, we can use it from every other method. This is the bread and butter. Technically there should be one more argument in this function for 'Category', but since we never use it, we might as well not waste the bytes to define it.
The most fully qualified gettext function . It has every option . Since it has every option we can use it from every other method . This is the bread and butter . Technically there should be one more argument in this function for Category but since we never use it we might as well not waste the bytes to define it .