locizify 9.0.6 → 9.0.7

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
+ ### 9.0.7
2
+
3
+ - update i18nextify
4
+
1
5
  ### 9.0.6
2
6
 
3
7
  - update i18nextify
@@ -1190,7 +1190,7 @@
1190
1190
  type
1191
1191
  });
1192
1192
  } catch (err) {
1193
- if (!Intl) {
1193
+ if (typeof Intl === 'undefined') {
1194
1194
  this.logger.error('No Intl support, please use an Intl polyfill!');
1195
1195
  return dummyRule;
1196
1196
  }
@@ -1376,16 +1376,16 @@
1376
1376
  var value;
1377
1377
  var clonedOptions;
1378
1378
  var handleHasOptions = (key, inheritedOptions) => {
1379
- var _matchedSingleQuotes$;
1379
+ var _matchedSingleQuotes$, _matchedDoubleQuotes$;
1380
1380
  var sep = this.nestingOptionsSeparator;
1381
1381
  if (key.indexOf(sep) < 0) return key;
1382
- var c = key.split(new RegExp("".concat(sep, "[ ]*{")));
1382
+ var c = key.split(new RegExp("".concat(regexEscape(sep), "[ ]*{")));
1383
1383
  var optionsString = "{".concat(c[1]);
1384
1384
  key = c[0];
1385
1385
  optionsString = this.interpolate(optionsString, clonedOptions);
1386
1386
  var matchedSingleQuotes = optionsString.match(/'/g);
1387
1387
  var matchedDoubleQuotes = optionsString.match(/"/g);
1388
- if (((_matchedSingleQuotes$ = matchedSingleQuotes === null || matchedSingleQuotes === void 0 ? void 0 : matchedSingleQuotes.length) !== null && _matchedSingleQuotes$ !== void 0 ? _matchedSingleQuotes$ : 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
1388
+ if (((_matchedSingleQuotes$ = matchedSingleQuotes === null || matchedSingleQuotes === void 0 ? void 0 : matchedSingleQuotes.length) !== null && _matchedSingleQuotes$ !== void 0 ? _matchedSingleQuotes$ : 0) % 2 === 0 && !matchedDoubleQuotes || ((_matchedDoubleQuotes$ = matchedDoubleQuotes === null || matchedDoubleQuotes === void 0 ? void 0 : matchedDoubleQuotes.length) !== null && _matchedDoubleQuotes$ !== void 0 ? _matchedDoubleQuotes$ : 0) % 2 !== 0) {
1389
1389
  optionsString = optionsString.replace(/'/g, '"');
1390
1390
  }
1391
1391
  try {
@@ -1858,6 +1858,11 @@
1858
1858
  }
1859
1859
  });
1860
1860
  };
1861
+ var SUPPORT_NOTICE_KEY = '__i18next_supportNoticeShown';
1862
+ var getSupportNoticeShown = () => typeof globalThis !== 'undefined' && !!globalThis[SUPPORT_NOTICE_KEY];
1863
+ var setSupportNoticeShown = () => {
1864
+ if (typeof globalThis !== 'undefined') globalThis[SUPPORT_NOTICE_KEY] = true;
1865
+ };
1861
1866
  var usesLocize = inst => {
1862
1867
  var _inst$modules, _inst$modules2, _inst$options;
1863
1868
  if ((inst === null || inst === void 0 || (_inst$modules = inst.modules) === null || _inst$modules === void 0 || (_inst$modules = _inst$modules.backend) === null || _inst$modules === void 0 || (_inst$modules = _inst$modules.name) === null || _inst$modules === void 0 ? void 0 : _inst$modules.indexOf('Locize')) > 0) return true;
@@ -1920,8 +1925,9 @@
1920
1925
  if (typeof this.options.overloadTranslationOptionHandler !== 'function') {
1921
1926
  this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
1922
1927
  }
1923
- if (this.options.showSupportNotice !== false && !usesLocize(this)) {
1924
- if (typeof console !== 'undefined' && typeof console.info !== 'undefined') console.info('🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙');
1928
+ if (this.options.showSupportNotice !== false && !usesLocize(this) && !getSupportNoticeShown()) {
1929
+ if (typeof console !== 'undefined' && typeof console.info !== 'undefined') console.info('🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙');
1930
+ setSupportNoticeShown();
1925
1931
  }
1926
1932
  var createClassOnDemand = ClassOrObject => {
1927
1933
  if (!ClassOrObject) return null;