Skip to content

feat(i18n): consume central translations from dev.escalated:escalated-locale#58

Merged
mpge merged 2 commits into
mainfrom
feat/central-locale
May 10, 2026
Merged

feat(i18n): consume central translations from dev.escalated:escalated-locale#58
mpge merged 2 commits into
mainfrom
feat/central-locale

Conversation

@mpge
Copy link
Copy Markdown
Member

@mpge mpge commented May 2, 2026

Summary

Wire the helpdesk's MessageSource to the new central translations artifact dev.escalated:escalated-locale, with a host-app override layer.

  • New MessageSourceConfig registers a ReloadableResourceBundleMessageSource chaining two basenames (first match wins):
    1. classpath:i18n/overrides/messages — sparse host-app overrides (src/main/resources/i18n/overrides/)
    2. classpath:META-INF/escalated/locale/messages — shipped by the central artifact
  • EscalatedAutoConfiguration @Imports the new config so it is registered automatically.
  • Adds implementation(\"dev.escalated:escalated-locale:0.1.0\") to build.gradle.kts.
  • Seeds src/main/resources/i18n/overrides/ with .gitkeep + a README explaining the convention.
  • README + CHANGELOG updated.

Translation content in this repo is intentionally untouched — once the central artifact resolves on the classpath it shadows the existing messages_{locale}.properties files at the root of src/main/resources/. A follow-up will delete those files in this repo (and every host plugin) once the central artifact is verified end-to-end.

Assumed packaging convention

The central artifact is assumed to ship its bundles at:

```
META-INF/escalated/locale/messages_{locale}.properties
```

This avoids collisions with the host app's own messages.properties, mirrors how Spring Boot ships its own bundles under META-INF, and matches the basename chain wired here. If the central artifact ends up using a different path, only the CENTRAL_BASENAME constant in MessageSourceConfig needs to change.

Blocked on dev.escalated:escalated-locale v0.1.0 Maven Central publish

Expected CI failure: ./gradlew build will fail to resolve dev.escalated:escalated-locale:0.1.0 because the artifact has not yet been published to Maven Central. Sonatype + GPG setup for the new repo is still in flight. This PR is intentionally DRAFT until the artifact is reachable from mavenCentral().

Once the publish lands, ./gradlew build should resolve cleanly with no further changes here.

Test plan

  • ./gradlew build succeeds after dev.escalated:escalated-locale:0.1.0 is on Maven Central
  • App boots; MessageSource resolves status.open to a non-code value (i.e. a real translation, not the key) for at least one locale shipped by the central artifact (pt_BR, it, ja, …)
  • Drop a sparse src/main/resources/i18n/overrides/messages_en.properties with status.open=Active and confirm the override wins over the central bundle
  • Confirm Locale.ROOT / unknown locale falls through to the central default bundle (no setFallbackToSystemLocale)
  • Follow-up PR: delete src/main/resources/messages_*.properties once central artifact is verified

mpge added 2 commits May 1, 2026 22:10
Add a MessageSource bean backed by ReloadableResourceBundleMessageSource
that chains two basenames so the helpdesk consumes translations from the
central dev.escalated:escalated-locale Maven artifact while still allowing
host-app overrides:

  1. classpath:i18n/overrides/messages  -- local sparse overrides
  2. classpath:META-INF/escalated/locale/messages  -- central artifact

Add the dependency to build.gradle.kts and seed the overrides directory
with a .gitkeep + README explaining the convention.
…GELOG

Explain the basename chain (overrides -> central) and point host-app
authors at the overrides directory for sparse customization.
@mpge mpge marked this pull request as ready for review May 10, 2026 00:43
@mpge mpge merged commit 41aa928 into main May 10, 2026
0 of 2 checks passed
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