Sourced from i18next-cli's changelog.
1.88.0
- feat(lint, instrument):
acceptedAttributesalso takes an object that sets the translatable attributes per JSX element, e.g.{ '*': ['!label'], Button: ['label'], 'Select.Option': ['hint'] }: a name adds an attribute to the recommended list,!nameremoves it,'*'applies first. The same prop name can mean different things on different components (labelis a button's text but a chart axis's data key). Set inextract, the rules apply tolintand now also toinstrument; the array form is unchanged. See "Translatable attributes per element" in the README.- fix(extract): when a
t()or<Trans>key appears more than once, a default given in source (t('key', 'Text'),defaults="...") now wins over<Trans>children, and both win over a fallback built from the key, whatever the order of files and calls; an empty default ('') beats only the key fallback, never text. An empty<Trans i18nKey="ns:key" />no longer blocks the text of a later<Trans>. A default equal to the key now counts as a source default:t('key', 'key')keeps its value next tot('key', 'Text')(the first one wins), andwarnOnConflictsflags the pair.warnOnConflictsno longer flags a plural key without a default. Plugins get where a default came from in the new optionalExtractedKey.defaultValueSource. (#329, thanks@​skoeva).- fix(extract): the primary language gets what i18next 27 and react-i18next 18 render for an empty default.
t('key', '')andt('key', { defaultValue: '' })write""instead of the key, since i18next 27 returns''for them (plural forms included).<Trans defaults="">still writes its children or the key, which is what react-i18next falls back to.- docs: the Quick Start has a copyable one-prompt setup for coding agents (
npx i18next-cli localize --print-agent-prompt).
0b15991
1.88.0ba28709
fix(extract): follow i18next 27 and react-i18next 18 for empty and
dynamic Tr...d496449
docs: copyable one-prompt agent setup in the Quick Start; list where the
prom...2451085
fix(extract): preserve source defaults during deduplication (#329)f797b6a
feat(lint, instrument): set translatable attributes per JSX element992d266
docs: the status comment on optional plural forms describes the
runtime's _ot...