locizify 8.0.1 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 8.0.2
2
+
3
+ - update i18next-locize-backend
4
+
1
5
  ### 8.0.1
2
6
 
3
7
  - update i18next-locize-backend
@@ -7692,7 +7692,7 @@
7692
7692
  this.isProjectNotExisting = true;
7693
7693
  }
7694
7694
  if (this.isProjectNotExisting) {
7695
- callback(new Error("locize project ".concat(this.options.projectId, " does not exist!")));
7695
+ callback(new Error(this.isProjectNotExistingErrorMessage));
7696
7696
  return deferred;
7697
7697
  }
7698
7698
  this.getLanguagesCalls = this.getLanguagesCalls || [];
@@ -7702,12 +7702,26 @@
7702
7702
  if (!_this3.somethingLoaded && info && info.resourceNotExisting) {
7703
7703
  _this3.isProjectNotExisting = true;
7704
7704
  _this3.storage.setProjectNotExisting(_this3.options.projectId);
7705
- var e = new Error("locize project ".concat(_this3.options.projectId, " does not exist!"));
7706
- var _clbs = _this3.getLanguagesCalls;
7707
- _this3.getLanguagesCalls = [];
7708
- return _clbs.forEach(function (clb) {
7709
- return clb(e);
7705
+ var errMsg = "locize project ".concat(_this3.options.projectId, " does not exist!");
7706
+ _this3.isProjectNotExistingErrorMessage = errMsg;
7707
+ var cdnTypeAlt = _this3.options.cdnType === 'standard' ? 'pro' : 'standard';
7708
+ var otherEndpointApiPaths = getApiPaths(cdnTypeAlt);
7709
+ var urlAlt = interpolate(otherEndpointApiPaths.getLanguagesPath, {
7710
+ projectId: _this3.options.projectId
7710
7711
  });
7712
+ _this3.loadUrl({}, urlAlt, function (errAlt, retAlt, infoAlt) {
7713
+ if (!errAlt && retAlt && (!infoAlt || !infoAlt.resourceNotExisting)) {
7714
+ errMsg += " It seems you're using the wrong cdnType. Your locize project is configured to use \"".concat(cdnTypeAlt, "\" but here you've configured \"").concat(_this3.options.cdnType, "\".");
7715
+ _this3.isProjectNotExistingErrorMessage = errMsg;
7716
+ }
7717
+ var e = new Error(errMsg);
7718
+ var clbs = _this3.getLanguagesCalls;
7719
+ _this3.getLanguagesCalls = [];
7720
+ clbs.forEach(function (clb) {
7721
+ return clb(e);
7722
+ });
7723
+ });
7724
+ return;
7711
7725
  }
7712
7726
  if (ret) {
7713
7727
  _this3.loadedLanguages = Object.keys(ret);
@@ -7847,7 +7861,7 @@
7847
7861
  this.isProjectNotExisting = true;
7848
7862
  }
7849
7863
  if (this.isProjectNotExisting) {
7850
- var err = new Error("locize project ".concat(this.options.projectId, " does not exist!"));
7864
+ var err = new Error(this.isProjectNotExistingErrorMessage);
7851
7865
  if (logger) logger.error(err.message);
7852
7866
  if (callback) callback(err);
7853
7867
  return;