Skip to content

[Feature]: Promote i18n to Stable + message-extraction tooling and documented ICU coverage #141

Description

@JosunLP

Pre-flight checklist

  • I searched existing issues and did not find a duplicate request.
  • I explained the problem or use case, not just the desired API.

Problem or use case
i18n is Beta and grew in 1.14.0 (negotiateLocale, detectLocale, isRTL, formatRelativeTime, formatList, formatDisplayName, segment). First-party i18n is a real differentiator (React/Vue/Svelte mostly lean on third-party libs), but two gaps block both stability and adoption: there is no message-extraction tooling to pull translatable strings out of source, and the extent of ICU / complex-plural coverage is not documented. Teams can't commit to a localization workflow they can't extract for or whose plural support is unspecified.

Proposed solution
Freeze the formatting/locale API for one cycle, add an optional message-extraction tool that scans source for translation calls and emits/merges catalogs, and publish a precise statement of ICU MessageFormat coverage (plurals, selects, nested arguments) with examples — implementing any documented-but-missing cases. Keep extraction build-tool-agnostic and optional to preserve the zero-build path. Exit criteria: frozen API, extraction tool shipped, ICU coverage documented and tested, lazy-loading of catalogs documented.

Possible API or UX shape

import { defineMessages, t } from "@bquery/bquery/i18n";

const messages = defineMessages({
  cart: { items: "{count, plural, one {# item} other {# items}}" }
});

// Optional extraction (any bundler / CLI):
// bquery-i18n extract "src/**/*.ts" --out locales/en.json

Alternatives considered
Documenting that users should manage catalogs by hand — viable for tiny apps but a non-starter at scale and weaker than the mature i18n ecosystems around React/Vue. Shipping extraction as a mandatory build step — violates zero-build; it must be optional.

Relevant area
i18n

Additional context
This is both a stabilization and a competitive-strength ticket: getting extraction + documented ICU coverage turns first-party i18n from "nice to have" into a real reason to choose bQuery.

Metadata

Metadata

Assignees

No one assigned

    Labels

    i18nChanges to the i18n module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions