Skip to content

Add locale and lang/dir support for localized output#2396

Open
khashashin wants to merge 1 commit intoobservablehq:mainfrom
khashashin:khash/locale-lang-dir
Open

Add locale and lang/dir support for localized output#2396
khashashin wants to merge 1 commit intoobservablehq:mainfrom
khashashin:khash/locale-lang-dir

Conversation

@khashashin
Copy link

This PR adds plot-level locale support for internal formatting and optional language / direction metadata on the generated plot root.

Changes:

  • add top-level locale?: string
  • localize default numeric formatting for axes, legends, and tips
  • localize default time axis formatting
  • add optional lang?: string
  • add optional dir?: "ltr" | "rtl" | "auto"
  • derive lang from locale when omitted
  • derive dir from language when dir is omitted or "auto"
  • update docs and tests

This intentionally keeps translation catalogs, locale negotiation, and translation-key resolution out of Plot core.

Related:

If preferred, I can split lang / dir into a follow-up PR and keep this PR focused on locale only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant