Wednesday, July 14, 2010

Externalize/Internationalize Plug-in strings

Externalize / Internationalize Strings in plugin.xml

When we extend our plug-in projects with some extension.. there will be soo many attribute values such as Names, labels etc. It becomes tedious to change every such attributue if in case required in the later stage of the project.

The easier way to do it is to be able to see it all at one file(the .properties file).

This becomes of utmost importance when the developer is ignorant of the local language and would want to just type-in English texts for these attribute values..

The language interpreter could just refer to this one file(.properties file) and convert all the required strings into the local language without having to know the Extension implementation details.

How is this implemented??

note: This article is applicable only for externalization of PLugin.xml files.. If you are to externalize source files.. its a whole new procedure...
  • Create your plug-in project.
  • once you have completed with including all the required extensions, make sure you have completed with all the textual values of attributes such as name, label, etc
  • Now, select your plugin.xml file form the explorer view
  • right click >>
  • PDE Tools >>
  • Externalize Strings/Internationalize >>
  • choose and expand the plug-in of interest
  • choose the manifest.mf and the plugin.xml file one by one to check if you are alright with the appended changes.
  • You could even modify the 'substitution key ' values if preferred
  • Next>> check with the appended changes in each file under your plug-in
  • Finish
Now, you will have a new bundle.properties file in your project which will map all the strings to a certain value.

Check the below screenshot after externalization:

No comments:

Post a Comment