Repository navigation
Releases: shadowjs-dev/i18n
Releases · shadowjs-dev/i18n
Release list
1.0.3
Fixed
- A catalog loader that throws before its first await no longer leaves a rejected load behind: the next
loadcalls the loader again. createI18nMiddlewareunderprefix: "as-needed"negotiates the root path from the cookie andAccept-Languagelike the browser's detection, so hydration no longer flips the locale.formatRelativechooses the unit after rounding: 59.6 seconds is "in 1 minute", not "in 60 seconds" (same for hours, days, weeks, months and years).
1.0.2
Fixed
-
i18nHeadTagswritesog:localeas language and region (zh_TWforzh-Hant-TW) and skips duplicate alternates; it used to keep the script (zh_Hant-TW).
-
matchLocaleandnegotiateLocaleprefer the supported locale of the script a request implies (zh-TWgetszh-Hant, not the firstzh-*).
-
- A string passed as the values of a message, or a plain value under a rich-text tag's name, no longer throws (
MISSING_VALUE/MISSING_TAG_HANDLERinstead).
- A string passed as the values of a message, or a plain value under a rich-text tag's name, no longer throws (
-
hydratewith a snapshot whosemessagesis not an object throwsINVALID_STATE, not aTypeError.
-
- A
NaNparse limit (maxDepth,maxNodes,maxLength) means the default, not no limit, so deep input cannot overflow the stack.
- A
-
formatNumber,formatDateandformatRelativeno longer throw for an object with no usabletoString.
-
chain()of an undeclared tag is no longer cached, thecompileoption and theonErrorcallback used for catalog validation run untracked.
-
- The CLI:
readXliffno longer recurses per near-miss element name, andimportkeeps a__proto__key as data.
- The CLI:
-
- After
dispose(),t()inside aSuspenseboundary on a locale that never loaded no longer registers a holder that nothing releases.
- After
-
- A custom
PersistStrategyreadandwriterun untracked, so callingsetLocaleor creating the instance inside a computation no longer subscribes it to what the strategy reads.
- A custom
-
replaceCatalogwhile a loader is in flight discards that load's result: keys the new catalog dropped no longer come back.
-
- ICU:
=-1(a negative exact plural selector) is accepted, and a brace written in quotes ('}') inside anumber,dateortimestyle no longer ends the argument; the style is unquoted like message text.
- ICU:
-
- The XLIFF reader finds the end of a start tag outside quoted attribute values, so a raw
>in an attribute no longer breaks the unit.
- The XLIFF reader finds the end of a start tag outside quoted attribute values, so a raw
shadow-i18nreads catalogs into an object without a prototype, so--base constructor(or--locale toString) is a missing locale, not a member ofObject.prototype.
1.0.1
Changed
- Released at 1.0.1 with the other packages, which share one version. No change to this package.
1.0.0
Added
- Typed message catalogs, translation parameters and reactive locale changes.
- Optional ICU messages, formatting, detection, persistence, routing and server hydration.
- Locale direction and bidirectional text support.
shadow-i18ncommand:check(catalogs against each other and against the code),extract, andexport/importof XLIFF 1.2 for translators, with--jsonoutput.