Skip to content

Incomplete type definition for getFixedT() return value #2318

@emersion

Description

@emersion

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions