Plugin UI text
From AzureusWiki
Here's how to add internationalized text to your UI, and replace !something! type labels with normal ones.
- Have a plugin written and know how to package it into a .jar, etc.
- Create a Messages.properties file with all the strings your UI uses. The file would look something like this:
yourplugin.name=Name of Your Plugin yourplugin.buttontext=Text on a button yourplugin.some.other.string=Other String that I'm using
Put the Messages.properties file in the same directory as your source code. - Use the strings in your code. For example:
LocaleUtilities lu = pluginInterface.getUtilities().getLocaleUtilities(); lu.integrateLocalisedMessageBundle("org.gudy.azureus2.pluginsimpl.webpeer.Messages"); //This is important! BasicPluginConfigModel config = pluginInterface.getUIManager().createBasicPluginConfigModel( "plugins", "yourplugin.name"); button = config.addActionParameter2("yourplugin.some.other.string","yourplugin.buttontext");
