-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type-safe messages - declare io.quarkus.qute.i18n.Message.value() as optional #25276
Type-safe messages - declare io.quarkus.qute.i18n.Message.value() as optional #25276
Conversation
2786e20
to
25e8b21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good. I've added some minor comments and I also need to take a closer look at the big changeset in the MessageBundleProcessor
...
extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleBuildItem.java
Show resolved
Hide resolved
extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java
Outdated
Show resolved
Hide resolved
extensions/qute/runtime/src/main/java/io/quarkus/qute/i18n/Message.java
Outdated
Show resolved
Hide resolved
extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java
Outdated
Show resolved
Hide resolved
extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java
Outdated
Show resolved
Hide resolved
extensions/qute/runtime/src/main/java/io/quarkus/qute/i18n/Message.java
Outdated
Show resolved
Hide resolved
25e8b21
to
586fde8
Compare
@mkouba thank you these are all good points, I pushed changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it would be interesting to know if the build time is not affected significantly by this PR. But we would need some real app sample to test it...
@michalvavrik Merged, thanks! |
@michalvavrik Would you care to send a follow-up PR and update the docs accordingly? |
@mkouba I can add an example and explain |
Resolves: #17857
This PR makes
io.quarkus.qute.i18n.Message#value()
optional. As a consequence, user can specify message templates for default locale only via localized file (that wasn't possible for Type-safe Message Bundles till now). When user provides message template both viaio.quarkus.qute.i18n.Message#value()
and localized file,io.quarkus.qute.i18n.Message#value()
value is preferred. Validation is in place, thus if value is not specified at all, exception is thrown. cc @mkouba