Skip to content
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

Conversation

michalvavrik
Copy link
Contributor

@michalvavrik michalvavrik commented Apr 29, 2022

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 via io.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

@quarkus-bot quarkus-bot bot added area/documentation area/qute The template engine labels Apr 29, 2022
@michalvavrik michalvavrik force-pushed the feature/type-safe-messages-optional-message-value branch 2 times, most recently from 2786e20 to 25e8b21 Compare April 30, 2022 09:04
@gastaldi gastaldi requested a review from mkouba April 30, 2022 12:39
Copy link
Contributor

@mkouba mkouba left a 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...

@michalvavrik michalvavrik force-pushed the feature/type-safe-messages-optional-message-value branch from 25e8b21 to 586fde8 Compare May 2, 2022 11:42
@michalvavrik
Copy link
Contributor Author

@mkouba thank you these are all good points, I pushed changes.

@michalvavrik michalvavrik requested a review from mkouba May 5, 2022 08:17
Copy link
Contributor

@mkouba mkouba left a 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...

@mkouba mkouba added this to the 2.10 - main milestone May 5, 2022
@mkouba mkouba merged commit 6c5eb47 into quarkusio:main May 5, 2022
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label May 5, 2022
@mkouba
Copy link
Contributor

mkouba commented May 5, 2022

@michalvavrik Merged, thanks!

@michalvavrik michalvavrik deleted the feature/type-safe-messages-optional-message-value branch May 5, 2022 09:18
@mkouba
Copy link
Contributor

mkouba commented May 5, 2022

@michalvavrik Would you care to send a follow-up PR and update the docs accordingly?

@michalvavrik
Copy link
Contributor Author

@mkouba I can add an example and explain Message#value is not required and prioritization strategy, if that's what you mean? I wasn't sure previously whether this change is significant enough for user to add this to documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation area/qute The template engine kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type-safe messages - consider declaring io.quarkus.qute.i18n.Message.value() as optional
2 participants