Skip to content

Commit 8942143

Browse files
committed
fix: function t() passed options alteration #1947
1 parent ad67e60 commit 8942143

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 22.4.15
2+
3+
- fix: function t() passed options alteration [1947](https://github.com/i18next/react-i18next/issues/1947)
4+
15
## 22.4.14
26

37
- fix: pass lng to format function used in nesting [1938](https://github.com/i18next/react-i18next/issues/1938)

i18next.js

+1
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@
672672
if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
673673
options = this.options.overloadTranslationOptionHandler(arguments);
674674
}
675+
if (_typeof(options) === 'object') options = _objectSpread$4({}, options);
675676
if (!options) options = {};
676677
if (keys === undefined || keys === null) return '';
677678
if (!Array.isArray(keys)) keys = [String(keys)];

i18next.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Translator.js

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class Translator extends EventEmitter {
9292
/* eslint prefer-rest-params: 0 */
9393
options = this.options.overloadTranslationOptionHandler(arguments);
9494
}
95+
if (typeof options === 'object') options = { ...options };
9596
if (!options) options = {};
9697

9798
// non valid keys handling

src/i18next.js

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class I18n extends EventEmitter {
9696
} else if (typeof Intl !== 'undefined') {
9797
formatter = Formatter;
9898
}
99-
10099

101100
const lu = new LanguageUtils(this.options);
102101
this.store = new ResourceStore(this.options.resources, this.options);

0 commit comments

Comments
 (0)