問題描述
Netbeans 菜單和 i18n (Netbeans menu and i18n)
I have a netbeans project, I want to internatialize it. I have a menu as wizards, how can I upload data from bundles instead of strings in it.
This is how it looks like now:
@ActionID(category = "Wizard", id = "com.xxx.xxx.EntWizWizardAction")
@ActionRegistration(iconBase = "com/xxxx/resources/wizard.png",
displayName = "Entities Wizard")
@ActionReferences({
@ActionReference(path = "Menu/Wizard", position = 0),
@ActionReference(path = "Toolbars/Wizard", position = 0)
})
Thanks!
‑‑‑‑‑
參考解法
方法 1:
Netbeans automatically does Internationalization for you this page Here explains it quite well Not sure if this was what you were looking for
A basic summary: Switch Automatic Internationalization On
1.Select the root node of your Form in the Navigator Window.
2.In the Properties window, select the checkbox in the Automatic Internationalization property.
If you need to have the Bundle.properties file in a different location, you can click the ellipsis (...) button to the right of the Properties Bundle File and choose a location or directly type the path in the property's text field.
3.In the Projects window, double‑click the Bundle.properties node in the Projects Window or right‑click the node and choose Edit.
The properties file is opened in the Source Editor. As you can see, all appropriate Keys and Values for Form FindDialog.java are generated. (The name of each key is derived from the form file name and the component Variable name. For example, the key FindDialog.jLabel1.text is generated for a component with the variable name jLabel1 placed in form file FindDialog. The value jLabel1 represents component's Text property in this example.