loadI18n(translationCollection) {
    let collection = translationCollection || Translations;
    let json;

    if (collection.find().count() > 0) {
      return;
    }

    let tenant = Tenants.findOne();
    if (tenant) {
      Core.Log.info(
        `Loading initialisation data for ${collection._name}`);
      if (!(tenant !== null ? tenant.languages : void 0)) {
        tenant.languages = [{
          i18n: "en"
        }];
      }

      for (let language of tenant.languages) {
        json = EJSON.parse(Assets.getText("data/i18n/" + language.i18n +
          ".json"));
        for (let item of json) {
          collection.insert(item, function (error) {
            if (error) {
              Core.Log.warn("Error adding " + language.i18n +
                " to " + collection._name, item, error);
            }
          });
          Core.Log.info("Success adding " + language.i18n +
            " to " +
            collection._name);
        }
      }
    } else {
      Core.Log.error("No tenant found. Failed to load languages.");
      return;
    }
  }
/**
   * loadI18n initialisation
   * @summary imports translation initialisation data
   * @param {Object} translationCollection - optional collection object
   * @returns {null} inserts collection
   */
loadI18n initialisation
@summary imports translation initialisation data
@param {Object} translationCollection - optional collection object
@returns {null} inserts collection
loadI18n initialisation @summary imports translation initialisation data @param { Object } translationCollection - optional collection object @returns { null } inserts collection
loadI18n(translationCollection) {
    let collection = translationCollection || Translations;
    let json;
    if (collection.find().count() > 0) {
      return;
    }
    let tenant = Tenants.findOne();
    if (tenant) {
      Core.Log.info(
        `Loading initialisation data for ${collection._name}`);
      if (!(tenant !== null ? tenant.languages : void 0)) {
        tenant.languages = [{
          i18n: "en"
        }];
      }
      for (let language of tenant.languages) {
        json = EJSON.parse(Assets.getText("data/i18n/" + language.i18n +
          ".json"));
        for (let item of json) {
          collection.insert(item, function (error) {
            if (error) {
              Core.Log.warn("Error adding " + language.i18n +
                " to " + collection._name, item, error);
            }
          });
          Core.Log.info("Success adding " + language.i18n +
            " to " +
            collection._name);
        }
      }
    } else {
      Core.Log.error("No tenant found. Failed to load languages.");
      return;
    }
  }
loadI18n ( translationCollection ) { let collection = translationCollection || Translations ; let json ; if ( collection . find ( ) . count ( ) > 0 ) { return ; } let tenant = Tenants . findOne ( ) ; if ( tenant ) { Core . Log . info ( ` ${ collection . _name } ` ) ; if ( ! ( tenant !== null ? tenant . languages : void 0 ) ) { tenant . languages = [ { i18n : "en" } ] ; } for ( let language of tenant . languages ) { json = EJSON . parse ( Assets . getText ( "data/i18n/" + language . i18n + ".json" ) ) ; for ( let item of json ) { collection . insert ( item , function ( error ) { if ( error ) { Core . Log . warn ( "Error adding " + language . i18n + " to " + collection . _name , item , error ) ; } } ) ; Core . Log . info ( "Success adding " + language . i18n + " to " + collection . _name ) ; } } } else { Core . Log . error ( "No tenant found. Failed to load languages." ) ; return ; } }
loadI18n initialisation
 @summary imports translation initialisation data
 @param {Object} translationCollection - optional collection object
 @returns {null} inserts collection
loadI18n initialisation @summary imports translation initialisation data @param { Object } translationCollection - optional collection object @returns { null } inserts collection