Locale Notice

Shows a number or date as the reader's locale would read it, so 1,000 isn't taken as 1 in Germany or 04/03 as the wrong day.

Stops1,000 read as one in Germany

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/locale-notice.json

The files land in your project. They're yours to edit.

Usage

locale-notice-usage.tsx
import { LocaleNotice, LocaleNumberField } from "@/components/ui/locale-notice"

<LocaleNotice value={1000} readerLocale="de-DE" onUseSafe={setUnits} />

What it catches

  • Numbers whose separators flip meaning between locales
  • Dates like 04/03 read day-first vs month-first
  • Decimal comma or point typed for the wrong locale
  • Offers an unambiguous form (SI grouping, worded month)

Props

LocaleNotice props
PropTypeDefault
value* (required)

The number or date you are about to show someone.

number | Date—
authorLocale

The locale it is written in.

string"en-US"
readerLocale* (required)

The locale of the person reading it, e.g. "de-DE".

string—
numberOptions

Number formatting (currency, fraction digits). Ignored for dates.

Intl.NumberFormatOptions—
onUseSafe

Called with a form no reader can misread ("1 000", "Mar 4, 2026"). Shows a one-tap fix when set.

(text: string) => void—
hereLabel

Label of the author column. `{place}` is filled in.

string"Here · {place}"
misreadText

Templates: `{value}`, `{place}`, `{there}`, `{misread}`, `{safe}` are filled in.

string"In {place}, {value} reads as {misread}."
sameText

Shown when both locales read the value the same way.

string"Reads the same in {place}."
safeLabel

Button text to use the unambiguous form.

string"Write {safe}"

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Notice and hints are polite live regions
  • Input has a visible label and is described by the hint
  • Keep button has an aria-label and title; icons are aria-hidden

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • Uses the browser's Intl data, which varies by browser version
  • Only compares two locales at a time
  • Can't know the reader's locale unless you pass it

What it stops

1,000 read as one in Germany

Also known as

locale · number format · decimal separator · intl · i18n · date format · lakh format · international users

Dependencies

Pairs well with