Sourced from i18next-cli's changelog.
1.74.1
- fix(extract): keys wrapped in parentheses are no longer dropped.
t(('key'))andt(cond ? 'a' : ('b'))produced nothing, which is easy to hit without meaning to, since Prettier wraps the longer branch of a ternary in parentheses when the call does not fit on one line. The same wrapper broke the options argument (t('item', ({ count }))extracted no plural forms), a parenthesized default value (t('welcome', ('Welcome!'))), key arrays and selectors (t((['a', 'b'])),t((($) => $.sel.key))),useTranslation(('ns')), and option values such as{ ns: ('other') }, which silently filed the key under the default namespace. Fixes #295.1.74.0
- fix(extract): finite dynamic keys now resolve through renaming imports.
import { ResourceStatus as Status } from './types'followed byt(`status.${s}`)used to expand to nothing, because the resolver's tables are keyed by the declared type name and nothing mapped the local binding back to it. Applies to type aliases, enums, interfaces,as constarrays and helper functions alike. Part of #294.- feat(extract):
node_modulesis no longer ignored unconditionally. The default ignore is dropped as soon as one of yourextract.inputpatterns mentions it. Glob a dependency's.d.tsto let the type-aware resolver expand the string unions and enums it declares, or glob a package's sources to extract the keys it ships. Fixes #294 and #213.
f470a28
1.74.19c19339
fix(extract): unwrap parenthesized expressions so keys are not dropped
#29543cba76
docs: warn about drift when extracting keys from a dependency's types #29484c8506
1.74.07e444f6
feat(extract): resolve types from node_modules and through renaming
imports #...dc45590
test(types-generator): use an absolute glob path so the merged-namespace
test...