fix(i18n): spell brought-in units like the written ones, spread a range on one measured term, and keep the written order #165
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!165
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/format-terms-spelling-range-order"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three
formatTermsdefects seen while reviewing the recipe view (compound quantities, 1.5).{3/4 cup + 1-2 tbsp}scaled for a French reader gave… + 1 3/4-6 1/4 càc, a French spelling next to the writtencup/tbsp. A brought-in unit now takes the reader's spelling only when a written unit already uses it (càs→càc), Gram's own otherwise (tsp): never a mix.1 3/4-6 1/4 tsp, more than 2 tbsp). It now goes on the most precise term where both bounds are amounts its unit measures and the high one stays below the unit above:1 cup + 3 1/2-5 tbsp. A scaled amount may round its bounds to what the unit measures (as the last term already did); an exact one must fall on it.2 cup + 2-4 tbspunchanged.{1 cup - 2 tbsp + 30 g}read1 cup + 30 g − 2 tbsp, which hid that each kind takes away on its own. The written order is kept; terms added are only moved first when the amount would start with a term taken away (1 cup − 2 tbsp, never−2 tbsp + 1 cup).Goldens: only the fallback text of a sum of several kinds follows the written order (
045:1 cup - 2 tbsp + 30 g, was1 cup + 30 g - 2 tbsp). Legacy digests unchanged. Docs (EN + FR):reference/api/i18n.mdx. No changeset: unreleased 1.5 behaviour.Checks: lint, typecheck, 3179 tests (3 new in
quantity.test.ts), conformance 120/120 + 24/24, check-changesets, docs build.