Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/i18n-remaining-built-in-strings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[fix] Built-in text in six components that was fixed English now follows the locale. Through the catalog, so a provider's translation or override replaces it: Tokenizer's `+N more` overflow count, Slider's screen-reader "Required", CodeBlock's `<language> diff` header label, the default label of a token made by `useChatPasteAsToken` (the same message the pasted-text chip uses), and the relative-date choices in PowerSearch's popover editor (the touch sheet already translated them). Through the locale's own unit formatting: Timer's elapsed durations, which read `34s`, `2m 08s` and `1h 05m` in English as before and use the locale's unit names elsewhere (German `2 Min., 08 Sek.`). Other English output is unchanged, except that Tokenizer groups the digits of a count of 1,000 or more; Timer's units are never grouped (`1000h 05m`, as before). Shipped locales show English for the new catalog keys until translators add them.

@nynexman4464
25 changes: 16 additions & 9 deletions docs/specs/AST-037-timer/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ affects_architecture:
architecture:public-component-api,
architecture:component-theming-surface,
architecture:react-component-runtime,
architecture:internationalization,
]
affects_families: []
affects_contributing: []
Expand Down Expand Up @@ -110,6 +111,12 @@ they are the only unit, padded after minutes, and omitted after hours. `clock`
uses colon-separated stopwatch notation: `m:ss` below one hour and `h:mm:ss`
from one hour onward.

The table shows English. Under a provider locale, `elapsed` writes each unit
with the locale's narrow unit name and digits and joins the units as the locale
does (German `2 Min., 08 Sek.`), through the shared time helper
(`architecture:internationalization` INV8); its units, padding and ladder are
the same in every locale. `clock` notation does not change with the locale.

## Requirements

- **FR1 — One semantic root.** Timer MUST render one `<time>` root whose visible
Expand Down Expand Up @@ -190,15 +197,15 @@ standard consumer attributes and styling otherwise reach the root.

## Verification

| Contract | Verification | Representative states | Mutation or failure expectation |
| ------------------ | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| FR1–FR5, FR11–FR13 | Focused Timer tests with a controlled clock and fake timers | Initial, default/earlier/future origin and future scheduling, delayed callback, each format ladder, 59:59→1:00:00 boundary, elapsed hour boundary | State-driven ticks, callback-count accumulation, negative values, needless pre-origin wakes, wrong padding/unit ladder, stale `dateTime`, wrong initial markup, redundant writes, or one-second post-hour elapsed wakeups fail |
| FR4 | React Profiler commit-count test | Several elapsed ticks and a composed sibling | Replacing owned-node mutation with React state produces extra update commits |
| FR6–FR7 | Resource spy tests under rerender, unmount, and StrictMode | Origin change, format change, replay, cleanup | Duplicate or leaked timer resources fail setup/cleanup counts and detached-node guards |
| FR8 | Public import, DOM passthrough, typography, styling merge, event, and ref tests | Root import, Timestamp defaults, each typography override, and representative BaseProps | Missing exports; divergent defaults; or dropped typography, attributes, handlers, class/style inputs, or root ref fail |
| FR9 | Accessibility attribute tests | Default and caller-declared live behavior | Timer adds unsolicited live semantics or drops deliberate caller ARIA |
| FR10 | Theming-target and knowledge checks | One root target across formats | Missing, extra, or misplaced target mapping fails repository validation |
| Browser contract | Storybook browser evidence | Default elapsed, clock, earlier origin, hour-scale elapsed, composed wait message | Visible output, semantic duration, geometry, or update-commit behavior differs from the contract |
| Contract | Verification | Representative states | Mutation or failure expectation |
| ------------------ | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FR1–FR5, FR11–FR13 | Focused Timer tests with a controlled clock and fake timers; `timeFormat.test.ts` elapsed-duration cases | Initial, default/earlier/future origin and future scheduling, delayed callback, each format ladder, 59:59→1:00:00 boundary, elapsed hour boundary, `elapsed` under a provider locale (`de-DE`), a 1,000-hour count | State-driven ticks, callback-count accumulation, negative values, needless pre-origin wakes, wrong padding/unit ladder, stale `dateTime`, wrong initial markup, redundant writes, or one-second post-hour elapsed wakeups fail, English output that is not `34s`/`2m 08s`/`1h 02m`, or locale unit names that are not applied |
| FR4 | React Profiler commit-count test | Several elapsed ticks and a composed sibling | Replacing owned-node mutation with React state produces extra update commits |
| FR6–FR7 | Resource spy tests under rerender, unmount, and StrictMode | Origin change, format change, replay, cleanup | Duplicate or leaked timer resources fail setup/cleanup counts and detached-node guards |
| FR8 | Public import, DOM passthrough, typography, styling merge, event, and ref tests | Root import, Timestamp defaults, each typography override, and representative BaseProps | Missing exports; divergent defaults; or dropped typography, attributes, handlers, class/style inputs, or root ref fail |
| FR9 | Accessibility attribute tests | Default and caller-declared live behavior | Timer adds unsolicited live semantics or drops deliberate caller ARIA |
| FR10 | Theming-target and knowledge checks | One root target across formats | Missing, extra, or misplaced target mapping fails repository validation |
| Browser contract | Storybook browser evidence | Default elapsed, clock, earlier origin, hour-scale elapsed, composed wait message | Visible output, semantic duration, geometry, or update-commit behavior differs from the contract |

## Decision log

Expand Down
6 changes: 2 additions & 4 deletions docs/specs/components/PowerSearch/PowerSearch.spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,7 @@ that the editor would not run).
date-range, and nested summaries ("{n} items", "date range", "{n} filters") as
English literals, joins the items of a list value with a literal ", " where
FR12's rows use the locale's list format, and shows a relative-date value as
the stored key (`3d_ago`), and its relative-date editor writes the choice
labels ("3 days ago") as English literals. `formatFilterValue` resolves its
the stored key (`3d_ago`). `formatFilterValue` resolves its
summaries from the catalog but differs from the token in four places: it
says "{n} entities" for an
entity list where the token says "{n} items"; it formats an `integer` or
Expand All @@ -1003,8 +1002,7 @@ that the editor would not run).
relative-date value as stored). The sheet presentation resolves all of these
from the catalog, or the locale's formats, on its own surfaces (FR12, FR20)
and shows the popover token's text on the trigger, except a date, which FR11
reads in `timezoneID` or its fallback zone; changing the token's and the
editor's own text is a separate stable change for the owner.
reads in `timezoneID` or its fallback zone.
- Known gap against `family:input-fields/FR10`, opened by DEC-3: the sheet
presentation's trigger composes Field for the box the tokenizer field has,
so PowerSearch is a component that composes Field, which FR10 binds
Expand Down
Loading
Loading