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

Support setting locale and charset for "default" Qute Variant #21405

Closed
famod opened this issue Nov 12, 2021 · 3 comments · Fixed by #22610
Closed

Support setting locale and charset for "default" Qute Variant #21405

famod opened this issue Nov 12, 2021 · 3 comments · Fixed by #22610
Assignees
Labels
area/qute The template engine kind/enhancement New feature or request
Milestone

Comments

@famod
Copy link
Member

famod commented Nov 12, 2021

Description

If I do not want to set the Variant for each TemplateInstance then the only way I could find to set it seems to be via TemplateLocator.
But usually I'm fine with how and from where templates are loaded, so implementing a TemplateLocator for this seems like overkill.

So it would be nice to have some way to configure which locale (and charset) is used.

Implementation ideas

Maybe extend (and rename?) quarkus.qute.content-types so that you can also specify locale and encoding?

Or just introduce quarkus.qute.locale and .encoding?

@famod famod added the kind/enhancement New feature or request label Nov 12, 2021
@quarkus-bot quarkus-bot bot added the area/qute The template engine label Nov 12, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 12, 2021

/cc @mkouba

@mkouba
Copy link
Contributor

mkouba commented Nov 12, 2021

Yes, there's even a TODO in the code :D
https://github.com/quarkusio/quarkus/blob/main/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/EngineProducer.java#L233-L236

Maybe extend (and rename?) quarkus.qute.content-types so that you can also specify locale and encoding?

We could start with quarkus.qute.default-locale and quarkus.qute.default-encoding. Although for encoding I'd encourage users to stay with the default - UTF-8.

@gsmet
Copy link
Member

gsmet commented Jan 1, 2022

@mkouba probably useful to have a look at LocalesBuildTimeConfig.

@mkouba mkouba self-assigned this Jan 4, 2022
@mkouba mkouba added this to the 2.7 - main milestone Jan 4, 2022
mkouba added a commit to mkouba/quarkus that referenced this issue Jan 4, 2022
- honor quarkus.default-locale and introduce
quarkus.qute.default-charset
- resolves quarkusio#21405
mkouba added a commit to mkouba/quarkus that referenced this issue Jan 5, 2022
- honor quarkus.default-locale and introduce
quarkus.qute.default-charset
- also fail the build if a localized interface does not extend a message
bundle interface
- resolves quarkusio#21405
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.

3 participants