Skip to content

Add strict YAML localization catalogs - #21

Merged
gregjotau merged 2 commits into
mainfrom
codex/strict-yaml-catalogs
Aug 8, 2026
Merged

Add strict YAML localization catalogs#21
gregjotau merged 2 commits into
mainfrom
codex/strict-yaml-catalogs

Conversation

@gregjotau

Copy link
Copy Markdown
Contributor

Summary

  • replace .properties bundles with locale-directory YAML catalogs under src/main/resources/i18n
  • add named message arguments plus compile-time _plural and _select patterns
  • generate locale selection and message branches directly into renderers
  • configure default and supported BCP 47 locales through the Gradle plugin
  • migrate the example and document the strict catalog profile

Safety and runtime model

  • uses the YAML 1.2 failsafe schema so every scalar remains text
  • rejects duplicate keys, tags, anchors, aliases, sequences, multiple documents, unsupported locales, unreachable plural categories, and locale key or argument drift
  • checks plural/select argument types against page-model properties and validates enum variants
  • keeps SnakeYAML Engine on the compiler path only; request-time rendering has no catalog parser or lookup engine
  • embeds integer cardinal rules derived from Unicode CLDR 49 and evaluates the effective catalog locale, including default fallback

Breaking changes

  • message catalogs now use .yaml; Java properties bundles are no longer loaded
  • template arguments are named, for example #{home.title(version=${version})}
  • the default catalog directory is src/main/resources/i18n

Verification

  • ./gradlew build --console=plain
  • compiler tests cover strict YAML behavior, locale parity, named arguments, plural/select structures, and invalid inputs
  • runtime tests cover representative CLDR categories and unsupported locales
  • the migrated English/Norwegian example compiles its generated renderer successfully

@gregjotau
gregjotau merged commit 438b1a4 into main Aug 8, 2026
2 checks passed
@gregjotau
gregjotau deleted the codex/strict-yaml-catalogs branch August 8, 2026 14:39
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