Sourced from i18next-cli's changelog.
1.67.8
- fix(extract): make the key sort order transitive, so
extractis idempotent. The comparator compared base keys for plural/plural pairs but full keys for every other pair, which produced a cycle (foo_solved < foo_zero < foo_one < foo_other < foo_solved) for a key that has both plural forms and a context variant in a locale with azeroplural (lv, ru, pl, lt, uk, …). The resulting order then depended on the input order, so the same file flipped key order back and forth on every extract/download cycle. Keys are now always compared by base key first, then by variant rank (plain key, cardinal plurals, ordinal plurals) (#279).- feat(extract): resolve finite string-literal unions through the element type of an iterated array.
function f(items: IProps[])withitems.map(({ size }) => t(`some_${size}`))now expands to one key per union member, as does member access on the callback element (items.forEach(item => t(`some_${item.size}`))) and a typed array variable (const items: IProps[] = …). CoversT[],Array<T>andReadonlyArray<T>formap/forEach/flatMap/filter/find/some/every(#210).
773147b
1.67.8f3bff58
fix(extract): transitive key sort (#279);
resolve array element unions (#210)