Repository navigation
Conversation
Autocomplete, Notification, ProgressBar, LightBox, LightBoxGallery and
LightBoxGalleryItem used react-aria's useLocalizedStringFormatter, which
ignores TranslationProvider overrides and leaves ICU variables
unevaluated. They now use Flow's hook. Namespaces: Autocomplete,
Notification, ProgressBar and LightBox (the gallery parts share the
LightBox locale files).
LightBoxGallery's aria-roledescription comes from the locale files
("carousel" / "Karussell").
The dotEnv linter of CodeEditor reports its diagnostics in the active
locale (new CodeEditor locale files). Language loaders receive the
string formatter for that.
Without formatOptions, ProgressBar and DonutChart format their value
with the Intl unit "percent" in the active locale: "40%" in English,
"40,5 %" in German. The English output loses the space before "%".
FileCard's hard-coded en-US locale is fixed in #3585.
Closes #3423
Coverage Report for ./packages/components/
File CoverageNo changed files found. |
Co-authored-by: ins0 <2622534+ins0@users.noreply.github.com>
🚀 Preview DeploymentPreview environments are ready:
Images:
|
Lisa18289
left a comment
There was a problem hiding this comment.
The FileCard item of #3423 lands in #3585, which is still open and doesn't close the issue itself. If this merges first, #3423 closes with that item open. Could this say Part of #3423, and #3585 Closes #3423?
📐 Flow guideline: AGENTS.md › Development workflow · via /review-flow
| /** @internal */ | ||
| export interface LocalizedStringFormatter { |
There was a problem hiding this comment.
useLocalizedStringFormatter is public (public.ts → TranslationProvider/index.ts), but its new return type is @internal. With stripInternal: true in typescript-config/base.json, the published .d.ts references a type that isn't declared, so consumers get any (or TS2304 without skipLibCheck). test:compile stays green, so nothing catches it.
| /** @internal */ | |
| export interface LocalizedStringFormatter { | |
| export interface LocalizedStringFormatter { |
| showCodeIndentationMakers, | ||
| showLineNumbers, | ||
| showLinterMarkers, | ||
| stringFormatter, |
There was a problem hiding this comment.
CodeEditor relies on extensions staying stable – a new array reconfigures CodeMirror. stringFormatter changes identity with the provider's translations/translate, so an app passing them inline (e.g. translations={{…}} at the root) now reconfigures the editor on every root render. Could the linter read the formatter from a ref instead, keeping it out of these deps?
Autocomplete, Notification, ProgressBar, LightBox, LightBoxGallery and LightBoxGalleryItem used react-aria's
useLocalizedStringFormatter. It ignoresTranslationProvideroverrides and leaves ICU variables unevaluated. They now use Flow's hook from@/components/TranslationProvider.TranslationProvider:Autocomplete,Notification,ProgressBar,LightBox. The gallery parts share theLightBoxlocale files, so they useLightBoxtoo.aria-roledescriptioncomes from the locale files (carousel/Karussell).CodeEditor/locales). Language loaders now receive the string formatter.formatOptions, the value is formatted with the Intl unitpercentin the active locale instead of`${value} %`. English reads40%, German40,5 %. ProgressBar had the same fallback as DonutChart, so it is fixed along with it.FileCard's hard-coded
en-US(also listed in #3423) is fixed in #3585, which is whyFileSizeTextis untouched here.Visual changes
English renderings of ProgressBar and DonutChart lose the space before
%(30 %→30%). The baselines of the ProgressBar, DonutChart, SkeletonMode and IllustratedMessage scenarios need an update viaupdate-screenshots.Tests
All of them fail without the fix (checked by reverting the source changes):
TranslationProvider.browser.test.tsx› "a translation reaches the built-in text of" (one test per component)CodeEditor.browser.test.tsx› "CodeEditor reports dotEnv diagnostics in the active locale"LightBoxGallery.browser.test.tsx› "the gallery is announced as a carousel in the active locale"ProgressBar.browser.test.tsx,DonutChart.browser.test.tsx› "the percentage follows the active locale", plus the updated English assertionsCloses #3423