Jim, can you investigate this and let us know what the best approach will be? I suspect that we can take an approach similar to internationalization here and utilize a resource with all our hover text in it. i know netbeans has some support for automatically extracting strings for internationalization. Will that work for us or is there a better approach?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using Java internationalization is reasonable if our goal is to put the hover text in a properties file. Other than easing full internationalization, I don't see any particular reason to internationalize only the tool tips. Why is the hover text different from the labels and button labels?
That said, internationalization is pretty easy, and netbeans makes it easier. The following code was generated by using the Tools->Internationalization->Internationalize... dialog . (I added the comments)
// This finds and loads a file in your classpath called RT.properties
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("RT");
// This sets a button label to be the value matching the key "Add" in RT.properties
btnAdd.setText(bundle.getString("Add"));
// This sets the hover text of a button to be the value matching the key "Add_Comment_To_List" in RT.properties
btnAdd.setToolTipText(bundle.getString("Add_Comment_To_List"));
I expect it wouldn't take very long to use the netbeans tools to internationalize our entire GUI.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jon and I came to the conclusion that there isn't really a benefit to storing the hover text in a properties file. If such a benefit makes itself known (such as non-developers changing the text), it is easy enough to use Netbeans to do it at that time.
We still need to add the hover text, though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jim, can you investigate this and let us know what the best approach will be? I suspect that we can take an approach similar to internationalization here and utilize a resource with all our hover text in it. i know netbeans has some support for automatically extracting strings for internationalization. Will that work for us or is there a better approach?
Using Java internationalization is reasonable if our goal is to put the hover text in a properties file. Other than easing full internationalization, I don't see any particular reason to internationalize only the tool tips. Why is the hover text different from the labels and button labels?
That said, internationalization is pretty easy, and netbeans makes it easier. The following code was generated by using the Tools->Internationalization->Internationalize... dialog . (I added the comments)
// This finds and loads a file in your classpath called RT.properties
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("RT");
// This sets a button label to be the value matching the key "Add" in RT.properties
btnAdd.setText(bundle.getString("Add"));
// This sets the hover text of a button to be the value matching the key "Add_Comment_To_List" in RT.properties
btnAdd.setToolTipText(bundle.getString("Add_Comment_To_List"));
I expect it wouldn't take very long to use the netbeans tools to internationalize our entire GUI.
Jon and I came to the conclusion that there isn't really a benefit to storing the hover text in a properties file. If such a benefit makes itself known (such as non-developers changing the text), it is easy enough to use Netbeans to do it at that time.
We still need to add the hover text, though.
I added the last comment. I didn't realize I wasn't logged in.