@fkui/i18next-translate 6.32.0 → 6.33.0

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
@@ -2033,6 +2033,7 @@ let wrapper;
2033
2033
  * @param options - options for wrapper element attributes.
2034
2034
  */
2035
2035
  function createScreenReaderWrapper(options) {
2036
+ /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- technical debt */
2036
2037
  if (!getWrapper()) {
2037
2038
  wrapper = document.createElement("div");
2038
2039
  wrapper.id = "fkui-alert-screen-reader";
@@ -3076,9 +3077,6 @@ class PluralResolver {
3076
3077
  this.logger = baseLogger.create('pluralResolver');
3077
3078
  this.pluralRulesCache = {};
3078
3079
  }
3079
- addRule(lng, obj) {
3080
- this.rules[lng] = obj;
3081
- }
3082
3080
  clearCache() {
3083
3081
  this.pluralRulesCache = {};
3084
3082
  }
@@ -4234,7 +4232,19 @@ class I18n extends EventEmitter {
4234
4232
  clone.store = new ResourceStore(clonedData, mergedOptions);
4235
4233
  clone.services.resourceStore = clone.store;
4236
4234
  }
4237
- if (options.interpolation) clone.services.interpolator = new Interpolator(mergedOptions);
4235
+ if (options.interpolation) {
4236
+ const defOpts = get();
4237
+ const mergedInterpolation = {
4238
+ ...defOpts.interpolation,
4239
+ ...this.options.interpolation,
4240
+ ...options.interpolation
4241
+ };
4242
+ const mergedForInterpolator = {
4243
+ ...mergedOptions,
4244
+ interpolation: mergedInterpolation
4245
+ };
4246
+ clone.services.interpolator = new Interpolator(mergedForInterpolator);
4247
+ }
4238
4248
  clone.translator = new Translator(clone.services, mergedOptions);
4239
4249
  clone.translator.on('*', (event, ...args) => {
4240
4250
  clone.emit(event, ...args);