@fkui/i18next-translate 6.35.0 → 6.36.1

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/dist/cjs/index.js CHANGED
@@ -3096,7 +3096,7 @@ class PluralResolver {
3096
3096
  type
3097
3097
  });
3098
3098
  } catch (err) {
3099
- if (!Intl) {
3099
+ if (typeof Intl === 'undefined') {
3100
3100
  this.logger.error('No Intl support, please use an Intl polyfill!');
3101
3101
  return dummyRule;
3102
3102
  }
@@ -3765,6 +3765,15 @@ const bindMemberFunctions = inst => {
3765
3765
  }
3766
3766
  });
3767
3767
  };
3768
+ let supportNoticeShown = false;
3769
+ const usesLocize = inst => {
3770
+ if (inst?.modules?.backend?.name?.indexOf('Locize') > 0) return true;
3771
+ if (inst?.modules?.backend?.constructor?.name?.indexOf('Locize') > 0) return true;
3772
+ if (inst?.options?.backend?.backends) {
3773
+ if (inst.options.backend.backends.some(b => b?.name?.indexOf('Locize') > 0 || b?.constructor?.name?.indexOf('Locize') > 0)) return true;
3774
+ }
3775
+ return false;
3776
+ };
3768
3777
  class I18n extends EventEmitter {
3769
3778
  constructor(options = {}, callback) {
3770
3779
  super();
@@ -3817,8 +3826,9 @@ class I18n extends EventEmitter {
3817
3826
  if (typeof this.options.overloadTranslationOptionHandler !== 'function') {
3818
3827
  this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
3819
3828
  }
3820
- if (this.options.debug === true) {
3821
- if (typeof console !== 'undefined') console.warn('i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com');
3829
+ if (this.options.showSupportNotice !== false && !usesLocize(this) && !supportNoticeShown) {
3830
+ 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 💙');
3831
+ supportNoticeShown = true;
3822
3832
  }
3823
3833
  const createClassOnDemand = ClassOrObject => {
3824
3834
  if (!ClassOrObject) return null;