I. Project Description

JavaScript can be used for web application development. JavaScript game targets browsers. Chaoyue Jiang, Peng Xu, Sun Da and I together formed a team to localize a JavaScript game called Boxie Coody. This game is a derivative of Sokoban. The source language of this game is English; our team localizes the game into four languages: Chinese, German, Korean, and French.

Our team members are: Chaoyue Jiang, Peng Xu, Sun Da, and me(Yuhan Song).

II. Overview of The Project

Preparation Phase

At first, our team tried to use “24 Ways”(an i18n solution for JavaScript games developed by a team called 24 Ways) to localize our game. With a global I18n object, 24 Ways allows game developers to localize a game into different languages without creating new codes. However, 24 Ways was not successfully implemented into Boxie Coody. 

Localization Phase

The special things about this game are the texts of this game are in “en.js”, and “en.js” file only function names and their text, which means it is easy to extract. Then, we decided to add a function in JavaScript to switch between different languages. Following the instructions on Stackflow (https://stackoverflow.com/questions/20597066/how-to-switch-between-2-javascript-files), we added a language switcher.

The Language Switcher

Translation Phase

After realizing the language-switching function, we are going to translate the strings in JavaScript. Since all of them were in one JS file, we came up with two methods to translate texts in the file.

The first method manually extracts strings from the JS file. But this game is quite special, words that don’t need to be translated are very few and neat. Therefore, by manually deleting them, we were able to put them into Phrase for translation. 

However, some strings failed to be omitted because it was extracted manually. Thus, it was a little bit hard to put the translation back into the JS file.

The second method is to create a termbase that can exclude keywords in the JS file. Using this method, Phrase will not translate those codes into other languages, which is an efficient and secure way.

III. Challenges and Lessons Learned

Challenges

  1. Implementing 24 Ways. During this process, we found it was quite difficult for us to implement 24 Ways. Each of us tried at least two times, but all failed. The reason why 24 Ways cannot be implemented in this game is probably that all strings are in a dictionary rather than in parentheses.
  2. Extracting strings from JS file. Except for the two methods I mentioned above, I also tried to use “Gettext” to extract the strings. It turned out that this method attempted to fit those strings that are separated in different places in the file. For example, in the picture below, “Request Invitation” is embedded in the button. Therefore, by using the Gettext function, the terminal can find and extract the text.

Lessons learned

  1. Start Early. Since no one would know what will happen during the process, a team should start as early as possible once a project has been decided. At first, we thought localizing a game is easy, but it turned out that many difficulties were not been expected. Starting a project early can leave a team some time to generate Plan B if their initial plan doesn’t work.
  2. Never expect a method will work for every situation. If you fail to implement a method, be brave to explore a new one. Each instance is different, by switching a method, you may find a new way that may be easier.

Overall, localizing a JavaScript game is tough but interesting; it not only requires localization knowledge but also need us to know a little bit about coding in JavaScript. At last, I want to express thanks to my teammates for having such a good collaboration.

Feel free to check the Video below to see my personal reflection of the project.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

css.php