InteractiveMessenger: Message translation and formatting library

InteractiveMessenger is a library that can be used in Minecraft server plugins (using the Bukkit API). Since Minecraft is played all over the world and players speak a lot of different languages, one of the first things added to AreaShop was the option to translate all messages. Later this functionality evolved to support new features of Minecraft to let players click on pieces of text to open a link, use a command or see extra information. The library is open-source and is found on Github. A Maven repository is also available from my Jenkins build server.

GitHub

Features

The library has a lot of advanced features to be suitable for most plugins:

  • Translation: Import and export messages to Transifex to make use of volunteers to translate the messages (currently AreaShop has 202 volunteers among 30 languages).
  • Variables: Add placeholders to the messages to be replaced with relevant information later.
  • Composition: Insert messages into others, to extract common formatting or patterns.
  • Actions: Option to let players click on message parts to use a command or open a web page.
  • Colors and formatting: Simple tags to add colors and formatting (bold, italic, underline, etcetera).

Examples

Examples can be found in the documentation, AreaShop source and two messages are shown below.

Screenshot 4

Screenshot 5

Automated tests

A good part of the library is covered by unit tests, to ensure subtle behaviour of colors, formatting and composition works correctly. It also has a test that can be run on an actual Minecraft server to test how the messages actually appear in the Minecraft client.