feat(i18n): consume central translations from dev.escalated:escalated-locale#58
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wire the helpdesk's
MessageSourceto the new central translations artifactdev.escalated:escalated-locale, with a host-app override layer.MessageSourceConfigregisters aReloadableResourceBundleMessageSourcechaining two basenames (first match wins):classpath:i18n/overrides/messages— sparse host-app overrides (src/main/resources/i18n/overrides/)classpath:META-INF/escalated/locale/messages— shipped by the central artifactEscalatedAutoConfiguration@Imports the new config so it is registered automatically.implementation(\"dev.escalated:escalated-locale:0.1.0\")tobuild.gradle.kts.src/main/resources/i18n/overrides/with.gitkeep+ a README explaining the convention.Translation content in this repo is intentionally untouched — once the central artifact resolves on the classpath it shadows the existing
messages_{locale}.propertiesfiles at the root ofsrc/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 underMETA-INF, and matches the basename chain wired here. If the central artifact ends up using a different path, only theCENTRAL_BASENAMEconstant inMessageSourceConfigneeds to change.Blocked on dev.escalated:escalated-locale v0.1.0 Maven Central publish
Expected CI failure:
./gradlew buildwill fail to resolvedev.escalated:escalated-locale:0.1.0because 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 frommavenCentral().Once the publish lands,
./gradlew buildshould resolve cleanly with no further changes here.Test plan
./gradlew buildsucceeds afterdev.escalated:escalated-locale:0.1.0is on Maven CentralMessageSourceresolvesstatus.opento 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, …)src/main/resources/i18n/overrides/messages_en.propertieswithstatus.open=Activeand confirm the override wins over the central bundleLocale.ROOT/ unknown locale falls through to the central default bundle (nosetFallbackToSystemLocale)src/main/resources/messages_*.propertiesonce central artifact is verified