-
Notifications
You must be signed in to change notification settings - Fork 83
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
set different ResourceBundle for different Views #64
Comments
Hello, I can't understand how can I set the locale of resourceBundle used by the views, and if it's possible to change it at runtime. Thanks in advance for your help, |
Hi Matteo, until now I haven't gotten a reply from Adem Bien. But Peter Rogge who is responsible for the Netbeans AfterburnerFX plugin gave me a good hint how to implement this. You have to understand that currently AfterburnerFX doesn't support customized Locale inserts during the creation of a view. Instead the view fetches the Locale from Locale.getDefault() automatically during instantiation. Moreover with FXML loading of resourceBundles switching resourceBundle on the flyis not possible. If you want your Scene to be shown with a different Locale then you have to recreate the view based on the new Locale like this:
|
Hi,
and
files in Other sources Package. |
hi there. For afterburnerFX one has to keep View, Presenter and all its language property files within the same package. Since afterburnerFX runs as "Convention over Configuration", one has to follow its naming conventions. For example:
So if you want to create a new view called "home", then you need to create a package called "home", presenter called "HomePresenter", view called "HomeView", fxml called home.fxml etc. Be advised that all files related to transfer must be located within the transfer package! |
Hi Adam,
I really appreciate your work with this small but very relevant DI plugin. I am working with internationalized strings both with Netbeans 8.1 and SceneBuilder. My app has many users and each user would want the Views display in his native language, but I don't know how to attach user-specific Locales to ResourceBundles which in turn can be injected into the Views.
With the standard javafx, I could change the language like this:
Is there an option to set resources within the View or any other solution would be greatly appreciated!
Thank you for your time,
Cheng
The text was updated successfully, but these errors were encountered: