Вопрос

I have a problem with Netbeans' auto-generated initComponents() method in my Swing app.

The problem is that it is generating bundle with no respect for locale:

java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("myapp/Bundle_en"); // NOI18N

instead of:

java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("myapp/Bundle", myLocale);

I've tried to set default locale to desired one before calling initComponents(), but it does not work for me. The result is that my UI has mixed languages.

Could anyone explain me what I am doing wrong, please?

Это было полезно?

Решение

I think you will be able to change generated code if you open your source and go to Tools | Internationalization | Internationalize.... There you can customize what expression is used to obtain I18N'ed value.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top