🐛 Bug Report
getFixedT() returns a special TFunction which supports an additional keyPrefix option:
|
if (o.keyPrefix && Array.isArray(key)) { |
However the TFunction type definition doesn't reflect this and is missing the keyPrefix option.
To Reproduce
const t = i18next.getFixedT('foo', 'bar');
t('hello', { keyPrefix: 'baz' });
This breaks when strict key checks are enabled, because keyPrefix is not taken into account. This is also confusing for documentation purposes: one needs to look into the source code to find out that this option exists.
Expected behavior
The returned TFunction should have a keyPrefix field in its options type definition.
Your Environment
- runtime version: node v24
- i18next version: 25.2.1
- os: Linux
🐛 Bug Report
getFixedT()returns a specialTFunctionwhich supports an additionalkeyPrefixoption:i18next/i18next.js
Line 1988 in defa00f
However the
TFunctiontype definition doesn't reflect this and is missing thekeyPrefixoption.To Reproduce
This breaks when strict key checks are enabled, because
keyPrefixis not taken into account. This is also confusing for documentation purposes: one needs to look into the source code to find out that this option exists.Expected behavior
The returned
TFunctionshould have akeyPrefixfield in its options type definition.Your Environment