Skip to content

Expand localization support to the requested locale set #466

Description

@leynos

Summary

Expand Netsuke's Fluent localization support to the following requested locale
set in one coordinated change:

  • ar
  • cs
  • cy
  • da
  • de
  • el
  • en-GB
  • es-419
  • es-ES (already present; audit and retain)
  • fa
  • fi
  • fr
  • gd
  • he
  • hi
  • hu
  • id
  • it
  • ja
  • ko
  • nb
  • nl
  • pl
  • pt-BR
  • pt-PT
  • ro
  • ru
  • sv
  • th
  • tr
  • uk
  • vi
  • zh-Hans
  • zh-Hant

en-US remains the source and fallback locale. es-ES already exists, so the
net addition is 33 locale catalogues.

Current state

  • Cargo.toml declares only en-US and es-ES.
  • src/cli_localization.rs embeds those two resources and dispatches every
    Spanish language tag to es-ES.
  • build_l10n_audit.rs hard-codes the two catalogue paths.
  • Tests and release-help paths contain several two-locale or en-US-specific
    assumptions.

Proposed work

  • Add complete Fluent catalogues under locales/<locale>/messages.ftl for all
    requested tags, retaining key names and variables from en-US.
  • Replace language-only dispatch with exact locale matching plus deliberate
    fallback rules, so es-419 and es-ES, pt-BR and pt-PT, and
    zh-Hans and zh-Hant remain distinct.
  • Make the build-time localization audit validate every declared locale rather
    than hard-coding two paths. Keep one authoritative locale registry shared by
    embedding, validation, metadata, and tests, or document why those surfaces
    cannot share it.
  • Update OrthoConfig metadata, rerun-if-changed declarations, CLI/runtime locale
    resolution, help generation, packaging, and relevant release paths.
  • Add parameterized unit and behavioural coverage for exact selection,
    language/region/script fallback, unsupported-locale fallback to en-US,
    Unicode rendering, interpolation variables, and CLDR plural categories.
  • Add bidirectional/RTL smoke coverage for ar, fa, and he; ensure output
    code does not insert direction-breaking assumptions.
  • Update docs/translators-guide.md, docs/users-guide.md,
    docs/netsuke-design.md, and docs/contents.md with the registry ownership,
    fallback policy, and translator workflow.

Translation quality

Machine-generated or copied English catalogues are not completion. Each locale
must be reviewed for terminology, Fluent syntax, interpolation variables,
plural rules, punctuation, and script/region appropriateness. Catalogue review
can be staged internally, but this issue is complete only when all requested
locales meet the same validation contract.

Acceptance criteria

  • All 34 requested locale tags are selectable, with en-US retained as
    the source/fallback locale.
  • All 33 new catalogues are complete and es-ES is audited against the
    current en-US key set.
  • Exact region/script variants are not collapsed into a generic language
    mapping.
  • The build-time audit discovers or iterates every declared locale and
    rejects missing keys, orphaned keys, and variable mismatches.
  • Parameterized tests cover every locale plus representative plural,
    interpolation, Unicode, and RTL behaviour.
  • Packaging includes every catalogue and generated help paths follow the
    documented locale policy.
  • Translator and user documentation list all supported locales and explain
    fallback behaviour.
  • make check-fmt, make lint, make test, make markdownlint, and
    make nixie pass.

References

  • locales/
  • Cargo.toml (package.metadata.ortho_config.locales)
  • src/cli_localization.rs
  • src/locale_resolution.rs
  • build.rs
  • build_l10n_audit.rs
  • docs/translators-guide.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestmediumCould be disruptive, but might not happentesting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions