I was recently involved in a project that supported three different languages. One of the things I grew to loath very quickly was the whole process of making sure all the property files were up to date. It didn’t take long for me to reach the point where I made it my mission to find a tool to make this easier. After doing some research, I found an Eclipse tool that reduces the work required to edit and maintain the property files.
As part of the Eclipse Babel project, there’s a little sub-project called the Message Bundle Editor. The project is apparently a descendant of some other project that was hosted on SourceForge. The project page is pretty sparse:
And you’ll notice there’s no installation instructions. An Eclipse update site for the plug-in doesn’t exist yet, but a request has been entered for this (Bug 279580). For now, if you want to check it out, you have to grab the source from CVS and install the plug-in yourself. The CVS instructions are here:
However, if you’re like me and you don’t develop Eclipse plug-ins, you start to wonder how one goes about creating and installing a plug-in from CVS. Here’s what worked for me using Eclipse 3.4.2:
1. Check out each of the projects as Eclipse projects using
2. Once you have all the project checked out into your workspace, you need to build the plug-in jar files. To do this, follow these steps for just ONE of the projects.
i. Find the MANIFEST.MF file located in the META-INF directory and double-click on it. You should see a plug-in property page like this.
ii. In the Export section, click on the “Export Wizard” link (item number 4). You should get something like:
iii. In the Export dialog, select all three projects and provide a path for the Destination directory. Once you’ve done this, Click Finish. The wizard should automatically build the plug-in files and create the directory you specified. When the export is finished, you should have a “plugins” sub-directory under your specified destination with the following files:
iv. To “install” the plug-in, you simply drop all three of these files in your Eclipse “plugins” directory (ECLIPSE_HOME/plugins) and restart Eclipse. After you restart, you should see something like this under Window->Preferences:
If you have installed the plug-in correctly, you should be able to open your property file and see something like so:
If you see block characters for Asian text on Windows, then you need to install the proper fonts. I’ll write another blog post with more details on this, but for now the short version is to launch the Control Panel applet called “Regional and Language Options” and select the appropriate boxes on the Languages tab.
A few observations/hints:
- Be sure to check out the formatting preferences, because the defaults will likely cause a massive re-arrangement of your property file text, which is usually undesirable if you’re maintaining an existing system
- Performance is just ok. You’re performance will likely vary based on the number of property files and the number of entries in each file. A bit of lag still FAR outweighs the multi-step manual synch process tho!
- I haven’t really pounded on this, so I can’t totally vouch for the stability. If you stumble on a bug or would like a feature, be sure to report it!
- If you have dedicated translators on your team, it should be pretty easy to grab a bare-bones eclipse install and throw this plug-in in to allow them to edit the property files.
Hopefully this will help take some of the drudgery out of I18N development!