Repository navigation
Update dependency i18next to v27.2.9 - #7
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
27.2.2→27.2.9Release Notes
i18next/i18next (i18next)
v27.2.9Compare Source
t('item', { count: 2n })picks the plural form instead of throwingTypeError: Cannot convert a BigInt value to a number: a BigIntcount(as some database drivers return forCOUNT(*)) is converted to a number forIntl.PluralRules,{{count}}still gets the BigInt, and0nlooks up_zerolike0. AboveNumber.MAX_SAFE_INTEGERthe form follows the rounded number. Thanks @Asimmimx (#2484)v27.2.8Compare Source
t()call withcontextlooks the key up along its own path in the namespace it names, instead of matching it against every key of every namespace. With several large namespaces each such call cost up to millions of type instantiations and could fail with TS2589, a literalcontext: 'x'soonest. A context value without a key is still an error, as since 25.9.0 (#2482)supportedLngs: ['en-US'],'EN'(from?lng=ENor a capitalised cookie) matches'en-US'like'en'and'EN-GB'already did, instead of falling back tofallbackLng, anddir('AR')returns'rtl'whereIntl.Localehas nogetTextInfo(). Thanks @anishkun (#2483)dir()also returns'rtl'for'AR'or'AR-EG'withcleanCode: falsewhereIntl.Localehas nogetTextInfo()(Node.js 22, some browsers)v27.2.7Compare Source
addResource, and with itsaveMissingwriting to the store, keeps a key below a number, a boolean or an array'slengthflat, like it already did below a string, instead of throwingCannot create propertyorInvalid array length. A request toi18next-http-middleware'smissingKeyHandlerwith{"a":5,"a.b":"x"}got a 500 from that throw.v27.2.6Compare Source
defaultValue: '':t('key', { count: 0, defaultValue_zero: '', defaultValue_other: '{{count}} items' })returns''instead of "0 items", and saveMissing saves''for a form given as''(key_zerotoo) instead of another form's text. A form without its own default savesdefaultValue, then theotherdefault, instead of the default resolved for the current count. Thanks @arba-octo (#2480)v27.2.5Compare Source
LoggerModule'slog,warnanderrortake one array, the way i18next calls them (log(args)); they were typed with rest parameters, so a logger typed to spread...argsgot the array as its only argument. Loggers typed either way still compile.I18nFormatModuledeclares the members i18next calls:init,parse,addLookupKeys,handleAsObjectandgetResource, all optional. It declared onlytype, so an object-literal i18n format with these members failed to compile.v27.2.4Compare Source
BackendModule.createtakes the parameters i18next passes it: a backend withcallbackApi: truegetscreate(languages, namespace, key, fallbackValue, callback, options), one withcallbackApi: falsegetscreate(languages, namespace, key, fallbackValue, options)and may return a promise. The types declared only the first four parameters, so a required fifth or sixth parameter failed to compile and an object-literal backend could not take them at all. One rare case now fails: acreate: (...args) => other.create(...args)that forwards to acreatetyped with exactly four parameters. The doc comments ofreadandreadMultinow describe their promise form (read(language, namespace)returning the data or a promise of it), which the types already accepted.getFixedT()takes its fourth parameter,{ scopeNs }, the full list of namespaces the returnedtis bound to, which selector keys use to find a namespace prefix; lookups still usens(react-i18next'suseTranslationpasses it).saveMissingPluralssays@default true, the runtime default since the option came in 10.3.0, notfalse.v27.2.3Compare Source
$t(key, { "name": "{{name}}" })is escaped once. With the defaultescapeValue: trueit was escaped for HTML before the options were parsed and again by the nestedt(), soTom & Jerrycame out asTom & Jerry(and react-i18next'sTranshas shownTom & Jerrysince 17.1.10, withescapeValue: falsetoo). These variables are now escaped for the options' JSON, whateverescapeValueis, and the nestedt()escapes them like the values of a direct call;defaultValueandjoinArraysthere, which it does not interpolate, stay escaped once. A value with",',\or a line break no longer breaks the options, withescapeValue: falsea value can no longer inject options such aslng, and withskipOnVariablesa{{placeholder}}inside a value is no longer interpolated a second time. The warning added in 26.0.6 now covers{{- var}}in these options, the one form still inserted unescaped, instead ofescapeValue: false.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.