@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/esm/index.js CHANGED
@@ -3094,7 +3094,7 @@ class PluralResolver {
3094
3094
  type
3095
3095
  });
3096
3096
  } catch (err) {
3097
- if (!Intl) {
3097
+ if (typeof Intl === 'undefined') {
3098
3098
  this.logger.error('No Intl support, please use an Intl polyfill!');
3099
3099
  return dummyRule;
3100
3100
  }
@@ -3763,6 +3763,15 @@ const bindMemberFunctions = inst => {
3763
3763
  }
3764
3764
  });
3765
3765
  };
3766
+ let supportNoticeShown = false;
3767
+ const usesLocize = inst => {
3768
+ if (inst?.modules?.backend?.name?.indexOf('Locize') > 0) return true;
3769
+ if (inst?.modules?.backend?.constructor?.name?.indexOf('Locize') > 0) return true;
3770
+ if (inst?.options?.backend?.backends) {
3771
+ if (inst.options.backend.backends.some(b => b?.name?.indexOf('Locize') > 0 || b?.constructor?.name?.indexOf('Locize') > 0)) return true;
3772
+ }
3773
+ return false;
3774
+ };
3766
3775
  class I18n extends EventEmitter {
3767
3776
  constructor(options = {}, callback) {
3768
3777
  super();
@@ -3815,8 +3824,9 @@ class I18n extends EventEmitter {
3815
3824
  if (typeof this.options.overloadTranslationOptionHandler !== 'function') {
3816
3825
  this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
3817
3826
  }
3818
- if (this.options.debug === true) {
3819
- 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');
3827
+ if (this.options.showSupportNotice !== false && !usesLocize(this) && !supportNoticeShown) {
3828
+ 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 💙');
3829
+ supportNoticeShown = true;
3820
3830
  }
3821
3831
  const createClassOnDemand = ClassOrObject => {
3822
3832
  if (!ClassOrObject) return null;