Show HN: Internationalizationext selector API – selector t for TypeScript

1 adrai 0 8/20/2025, 4:02:26 PM locize.com ↗
i18next released a new version of a new selector API that lets you pass a selector function to t instead of a string key:

// before i18next.t('my.nested.key')

// after i18next.t($ => $.my.nested.key)

The change unlocks IDE autocompletion and “go to definition”, preserves JSDoc from your resource files at the call site, and — critically — removes the huge type-level unions that used to grind TypeScript/IDEs to a halt. See the announcement and examples.

The selector support has landed in i18next (PR merged) and react-i18next has matching typings/changes. If you want to migrate, there’s an automated codemod to convert usages to the selector form.

Why share this here: if you use TypeScript + i18next, this should make working with large translation catalogs far more pleasant — less “doom scrolling”, much better editor UX, and big type-performance improvements. We’d love feedback from folks who try the codemod or hit edge cases. => https://github.com/i18next/i18next/pull/2322

Comments (0)

No comments yet