Quick Steps for Internationalization:

  1. Setup Policy class
    1. Copy a Policy class from another plug-in. (Note that some Policy's have an initAction method that depends on Images. If you don't want to bring Images along, you can remove this method.)
    2. In your Plugin class's start() method, call Policy.localize, passing the path to the properties file. For example:
      //Provides access to an/example/plugin/messages.properties
      Policy.localize("an.example.plugin.messages"); //$NON-NLS-1$
    3. In your Plugin class's stop() method, call Policy.cleanup().
  2. Hunt down Strings that need to be externalized. Two ways to do this:
    1. Under compilation preferences, turn on Externalize Strings as a warning or error, and then look for them in the Problems view.
      1. To externalize the string, replace the string with a call to Policy.bind("example.key"), and then place //$NON-NLS-1$ at the end.
    2. Alternatively, you can use the Externalize Strings tool. Right click on your package and select source code -> find strings to externalize.
      1. You need to configure wizard setup first though:
        1. Select Configure
        2. Change class name to point to your plugin's Policy class
        3. Change substitution pattern to be:
          bind(${key})
        4. and under Propert file location and name, change Package to be where you specified the location of messages.properties in your Plugin's start method.
        5. Note: You need to reconfigure the wizard every time you run it.
        6. Follow the wizard's instructions from there.

To internationalize your plugin.properties files, see Plugin Internationalization

[view] [edit]
(c) Copyright (c) 2004,2005 Refractions Research Inc. and others.