Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When starting a translation, try to check if there's anyone else working on the same locale. You can find out who they are by finding existing localization and looking at its CVS history. Try to get in touch with them to avoid a surprise.

Stapler plugin for IntelliJ IDEA

Refactoring the existing code to handle i18n correctly is tedious. So Stapler plugin for IntelliJ IDEA is developed to simplify this (note that JetBrains kindly offered the open-source license for the Hudson project, so contributers can get the license for free — contact Kohsuke if you need one.)

Once installed, this adds a menu item in the main menu, under "Refactor." It is highly recommended to give some keyboard short cut to this. I use "Ctrl+Alt+I":

Now, to use this feature, select the message you'd like to internationalize, then trigger this refactoring command. It'll ask you the message property name for this, so pick a name:

IDEA will place the message into the resource file, and adjust the code accordingly. Note that an error is highlighted until you run mvn compile again to generate new methods on the Messages class.