-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore: Reference contributor for Hilla translate method usage #288
base: main
Are you sure you want to change the base?
Conversation
Artifact build on last commit: distributions.zip. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for Hilla, good job!
I did not notice any change in Flow though, what should I expect?
With this update only |
Then I understood correctly and it is not working for Flow ;) . At least it still is showing the application properties file as options. ![]() ping @MarcinVaadin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Flow use case I still see all the application.properties options suggested if I click on a translate("server.port") translation.
Any chance we could include the I18NProvider.translate method in the Flow inspections as well? Would be nice for all 3 different approaches to be equally hi-lighted:
I understand you may want to do this in a separate PR, just throwing the idea out there since a customer is interested. |
Sure! |
@rodolforfq you meant If so, it's interface and implementation might be custom, not only based on properties file... |
@MarcinVaadin you are right. In that case, it should be com.vaadin.flow.i18n.DefaultI18NProvider#getTranslation as it is the default implementation and it uses the properties file. If a user creates a custom implementation, it is most likely not going to be based on the properties file and as such, no hi-lightning should be expected either. |
I took a second look at this. You can't call the static method on DefaultI18NProvider as you can on the interface. It doesn't make much sense to add this to the plugin after all. The Component#getTraslation method seems to be the most straightforward way to use the localization feature. While the static method on the I18NProvider interface is very useful for some specific cases (initializing an Enum with localized values, for example), it falls outside the scope of the framework itself. Please disregard my previous comments 🙇🏼♂️ |
Fixes #232