fix: fall back to Locale.ROOT when no i18n_en.properties exists for English locale#51
Merged
Merged
Conversation
Schmarvinius
approved these changes
Jul 24, 2026
Schmarvinius
self-requested a review
July 24, 2026 12:19
Schmarvinius
requested changes
Jul 24, 2026
Schmarvinius
approved these changes
Jul 24, 2026
Schmarvinius
left a comment
Contributor
There was a problem hiding this comment.
Not really a fix but more of a change or addition, but it's ok
Contributor
Author
|
Actually, technically it is a fix. Without i18n_en.properties, the application was throwing an exception at startup, something like:
This shouldn't happen for English since i18n.properties (no suffix) is the CAP convention for the default/English fallback. The fix makes the plugin treat it as such. |
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
The plugin calls
EdmxI18nProvider.getTexts(Locale.ENGLISH)to resolve English i18n texts. This reads the"en"key from the compiledi18n.json, which is only populated wheni18n_en.propertiesexists. Having onlyi18n.properties(the CAP convention default fallback) was not sufficient.Fix: When
getTexts(Locale.ENGLISH)returns no app-specific keys, fall back togetTexts(Locale.ROOT)which reads from the defaulti18n.propertiesfile.putIfAbsentensures that expliciti18n_en.propertiesentries always take precedence when both files exist.Changes
I18nHelper: when resolving English i18n texts, merge inLocale.ROOTentries as fallback viaputIfAbsent