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

Add localization support for the jte-spring-boot-starter-3 #418

Open
Gadnex opened this issue Jan 14, 2025 · 4 comments
Open

Add localization support for the jte-spring-boot-starter-3 #418

Gadnex opened this issue Jan 14, 2025 · 4 comments

Comments

@Gadnex
Copy link

Gadnex commented Jan 14, 2025

I have created a plugin for injecting an instance of gg.jte.support.LocalizationSupport into all Spring Boot ModelAndViews.

Details of my plugin can be found here:
https://github.com/Gadnex/jte-localizer-spring-boot-starter

The plugin is enabled by setting the Spring Boot application.properties value:
gg.jte.localizer.inject=true

I was hoping that the code for this plugin could be incorporated into jte-spring-boot-starter-3 and perhaps jte-spring-boot-starter-2, but not into the JTE core itself.

If there is interest in this, what can I do to help?

@Gadnex
Copy link
Author

Gadnex commented Jan 14, 2025

I was doing some more testing on my plugin and there still seems to be an issue to resolve.

It is currently always localizing to the messages in messages.properties and not to the correct locale.

I will report back if I solved the issue.

@Gadnex
Copy link
Author

Gadnex commented Jan 14, 2025

It seems the @RequestScoped @bean I created in my library only works if defined in the application itself and not the library.
I fixed the issue in version 1.0.1 and updated the documentation.

Unfortunately, the library now requires 3 @beans to be defined in code instead of the flag in application.properties.
But I guess the classes are still useful.

@Gadnex
Copy link
Author

Gadnex commented Jan 15, 2025

I had an idea overnight and i was able to fix the issue in the 1.0.0 release in a better way.
Now the plugin works like it was supposed to.

@casid
Copy link
Owner

casid commented Jan 18, 2025

Thank you for sharing @Gadnex.

I would suggest to give the plugin some time and usage and once all rough edges have been polished I can totally see this in the starter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants