Skip to content

Commit

Permalink
fix: function t() passed options alteration #1947
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Apr 19, 2023
1 parent ad67e60 commit 8942143
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 22.4.15

- fix: function t() passed options alteration [1947](https://github.com/i18next/react-i18next/issues/1947)

## 22.4.14

- fix: pass lng to format function used in nesting [1938](https://github.com/i18next/react-i18next/issues/1938)
Expand Down
1 change: 1 addition & 0 deletions i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@
if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
options = this.options.overloadTranslationOptionHandler(arguments);
}
if (_typeof(options) === 'object') options = _objectSpread$4({}, options);
if (!options) options = {};
if (keys === undefined || keys === null) return '';
if (!Array.isArray(keys)) keys = [String(keys)];
Expand Down
2 changes: 1 addition & 1 deletion i18next.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class Translator extends EventEmitter {
/* eslint prefer-rest-params: 0 */
options = this.options.overloadTranslationOptionHandler(arguments);
}
if (typeof options === 'object') options = { ...options };
if (!options) options = {};

// non valid keys handling
Expand Down
1 change: 0 additions & 1 deletion src/i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class I18n extends EventEmitter {
} else if (typeof Intl !== 'undefined') {
formatter = Formatter;
}


const lu = new LanguageUtils(this.options);
this.store = new ResourceStore(this.options.resources, this.options);
Expand Down

0 comments on commit 8942143

Please sign in to comment.