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

Allow to provide a default overridable value for Qute @Message #46259

Closed
ia3andy opened this issue Feb 13, 2025 · 2 comments · Fixed by #46280
Closed

Allow to provide a default overridable value for Qute @Message #46259

ia3andy opened this issue Feb 13, 2025 · 2 comments · Fixed by #46280
Labels
area/qute The template engine kind/enhancement New feature or request
Milestone

Comments

@ia3andy
Copy link
Contributor

ia3andy commented Feb 13, 2025

Description

Currently it's not possible to override a message value through a message properties files when specified by @message. I think we should add a boolean to specify if this value can be overridden by a properties file or not (or a defaultValue field).

This will allow to declare a MessageBundle in a roq-theme and allow user to override them in properties files.

For example:

@MessageBundle(value = "roq_theme", locale = "en")
public interface ThemeMessageBundle {

    @Message(defaultValue = "Contact me")
    String contact_title();

}

Implementation ideas

No response

@ia3andy ia3andy added the kind/enhancement New feature or request label Feb 13, 2025
@quarkus-bot quarkus-bot bot added the area/qute The template engine label Feb 13, 2025
Copy link

quarkus-bot bot commented Feb 13, 2025

/cc @mkouba (qute)

@mkouba
Copy link
Contributor

mkouba commented Feb 14, 2025

Yes, the @Message#value() always takes precedence as documented in https://quarkus.io/guides/qute-reference#message-templates. I think that @Message#defaultValue() would make sense.

mkouba added a commit to mkouba/quarkus that referenced this issue Feb 14, 2025
- this message template is only used if Message#value() is not specified
and a relevant message template is not defined in a localized file
- resolves quarkusio#46259
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants