You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Quarkus Development mailing list
Hi I've got a question, is there any way in Qute to set the localized language dynamically? So I push a button and everything is rendered in English, I push another one and then it is in Spanish.
Alex.
Martin Kouba
unread,
Feb 3, 2021, 5:25:36 AM2/3/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to asot...@redhat.com, Quarkus Development mailing list
Hi,
you can use a ResourceBundle in your template, and obtain the bundle
instance with one of the ResourceBundle.getBundle() methods (and pass
the relevant locale etc.).
Alternatively, you can try to use the Type-safe Message Bundles [1]. In
this case, the template variant [2] must be set as a TemplateInstance
attribute. The variant is set automatically for JAX-RS resources (in the
TemplateResponseFilter).
Ah sorry, I was wrong. Type-safe messages do not honor the selected
variant which is currently only used to select the correct template
(e.g. *.txt or *.html). The correct attribute name is "locale". This
needs to be documented.
Also it would probably make sense to take the locale from the selected
variant if the "locale" attribute is not set. I'll send a PR later today...
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Martin Kouba, Quarkus Development mailing list
Ok so what I need to do to make it work? Wait until a new version is released or there is a workaround? Because static annotation is not an option as it is not dynamic.
Martin Kouba
unread,
Feb 3, 2021, 7:41:17 AM2/3/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Alex Soto Bueno, Quarkus Development mailing list
On 03. 02. 21 13:18, Alex Soto Bueno wrote:
> Ok so what I need to do to make it work? Wait until a new version is
> released or there is a workaround?
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Martin Kouba, Quarkus Development mailing list
Great!! regarding this I was thinking if it would not be useful to create a Quarkus Qute configuration property that if it is set, then Qute automatically resolves the locale and sets it automatically. When I say automagically I am referring for example by checking the path param or header value or session attribute.
Martin Kouba
unread,
Feb 3, 2021, 9:52:09 AM2/3/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Alex Soto Bueno, Quarkus Development mailing list
On 03. 02. 21 15:20, Alex Soto Bueno wrote:
> Great!! regarding this I was thinking if it would not be useful to
> create a Quarkus Qute configuration property that if it is set, then
> Qute automatically resolves the locale and sets it automatically. When I
> say automagically I am referring for example by checking the path param
> or header value or session attribute.
So I'd like to try to create a PR (see the aforementioned issue #14794)
where the locale attribute is set based on the Accept-Language header
for JAX-RS resources.