Localization of Java Version of Starcraft.

The final project for course Software and Games Localization is a Java version of Blizzard’s 1998 Release, the starcraft. In this post, I’d like to walk you through the project details, as well as a specific difficulty we encountered when trying to localize this game.

But before we start, let’s take a look at these pictures of what the game looks like. Like I said before, this is a Java version of Starcraft. But in a more detailed description, I’d say this is more like a “Beta Version” since in this game, only Terran is available and you can only create SCV and Infants. The cool part, however, is that through Java, the author had re-created every core element of the classical RTS game.

In localizing/internationalizing this game, our aim was to add a “language selection panel” to enable the game to hop between 5 different languages: English, Chinese, Japanese, Spanish and French. The first part, was to create the language picker. Using Java GUI, we were able to achieve this goal with the help of API (Java 8.0). The hard part, however, was to make sure the language selection panel fits into the style and design of the game’s UI features, as shown below:

Original Main Menu:

After the Language Selection Panel plug-in

After the panel was added, we began our localization/internationalization process using Java class ResourceBundle. The way we did this can be described in the following steps:

  • Create a new class Object defaultLocale: Locale defaultLocale = new Locale(“en”, “US”).
  • Use Method ResourceBundle.getBundle() to create a ResourceBundle variable messages. ResourceBundle messages = ResourceBundle.getBundle(“MessagesBundle”, defaultLocale); the parameter “MessagesBundle” is the language file created under the Starcraft Project.
  • Create 5 language files named “MessagesBundle_en_US”, “MessagesBundle_fr_FR”, “MessagesBundle_zh_CN”, “MessagesBundle_jp_JR”, “MessagesBundle_es_US”, all of which are language resources the system can recognize as pools from which to pull out text strings.
  • Add Action Listener to the language selection panel so that each language button directs the relevant language resources as where text strings are pulled out.

As shown below:

The language selector works to load different language properties file into the system. However, as we tested its function, the language didn’t change. Our review of the project determined where the problem was: upon initiation, the system would language properties file first, followed by all the other functions and the GUI. The language selector works only after the game is launched. This means that when language properties files change, the GUI has already been loaded so that even if the text strings it is supposed to display change, it will not be loaded the second time.

In the light of this situation, we use this method: setText(). As shown below:

Turns out, it works just fine.

So it looks like this:
Original:

But as we tested the game, a more serious problem occurred: although the text strings are localized and appeared quite properly, the game could not be started – it just stopped at the interface where the drop-down menu appears.

We spent 3 days trying to figure out why, and were finally able to find the true cause:

In order to launch the game, the system will load an “opponent list” to record whether the player’s opponent is a computer AI or another player in the multi-player game mode. When selecting “single player”, the opponent list will only load “computer”, which is set to be a text string. Since we have translated “computer” into another language, the opponent will not load this text string, which means the player has no one to play with. That’s why the game couldn’t be launched.

 

The solution:

Find the Opponent List, and localize the “computer” text string.

 

After this step, everything is fine. The game runs smoothly, with every string localized.

Lesson:

When it comes to software or games localization, the hard part is to distinguish strings supposed to be translated from those that are not to be translated. People may be obsessed with fancy technologies. Of course, technologies are just important since they boost efficiency considerably. However, our emphasis should also be focused on the software itself.




Sites DOT MIISThe Middlebury Institute site network.