Show HN: Internationalizationext selector API – selector t for TypeScript
// 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
No comments yet