Why Unity?

Unity is the most commonly used game engine in the industry. It supports multiple languages like C#, JavaScript (UnityScript) or Boo. Unity is used to make games and other types of content for more than 25 platforms, including mobile, PC, WEB, AR, and VR. The use of Unity has expanded beyond games into film, animation, architecture, and automotive, etc. After learning to use Unity, our team was amazed by how powerful Unity is in creating movements, adjusting the atheistic of the elements, and building games, so we decided to work on something challenging but interesting — localizing a game that was built on Unity.

Intro to Our Project

After searching through tens of hundreds of games on UnityList, the open-source marketplace, our team came across a simple yet fun game — the Flappy Bird. In the game, players try to control a bird by clicking the mouses or tapping space bars to fly between obstacles without hitting them. We decided to localize it from English to simplified Chinese.

How did we localize it?

Although Unity has released its localization package (in Beta) We went with the I2 Localization plugin because we want to experiment not only on the strings, but also on other elements. We first imported the plugin as an asset. Then we played the game over and over again to identify the strings in the game. There are, in total, four strings in Flappy Bird, including Game OverFlap To RestartRecord, and Score

Localizing the Strings

The steps to localize strings in I2 Localization are pretty straightforward:

1. Add Languages

2. Add terms (keys) for each string

3. Locate the strings in .cs files. (They are usually in GUIManager and GameManager files.)

4. Wrap the strings with I2.Loc.LocalizationManager.GetTranslation(“TermName”).

However, the difficult part is actually locating the strings. We couldn’t find the Game Over and Flap To Restart strings in the codes. We later learned they were actually built-in texts in the GameOverText and RestartText objects.

So we literally added the strings of GameOverText and RestartText objects to the source cod.

  1. Analyze how other strings are written.
  2. Imitate the style and add the strings of GameOverText and RestartText into the GUIManager.cs file after analyzing what I already had for Record and Score.

a. “Public” the GameObject of gameOverText and “Private” the Text variable of gameovertext.

b. Add a GetComponent<Text> function to the variable.

3. Continue to localize the strings with I2 Localization as described above.

Localizing the Strings and Fonts

In order to provide a more comprehensive experience for the players and make this project even more challenging, we also decided to localize the fonts and sprites in the game as well. This can actually be done in I2 Localization too!

On Canva, We purchased some images (a Chinese-feeling sky, Chinese-style clouds, and bamboos) and edited them to make them fit into the games in terms of their sizes, lighting, and colors. We put them in the Sprites folder in the game assets.

The Steps are pretty simple:
1. Add a sprite (e.g. sky) as a Term in I2 Localization and select the Type as Sprite.
2. Select the Chinese-style sprite (e.g. sky_zh-CN) for simplified Chinese.

3. Select the element and add I2 Localize component to it.

4. Make sure the sprite for English and simplified Chinese were correctly set.

Localizing the Font

Very similar to localizing the sprites, all you need to do is to add a Term for fonts and add a component. The key is to select the Type as Font.

This is how the game looks like with Chinese-style sprites and fonts!

Debugging

After we successfully localized everything and added a language picker , we found a bug in the Chinese version: he bird would died even before hitting bamboos (which made the game super hard lol).

We started to dig into the files again and found that we need to adjust the Size of the Box Collider 2D component of bamboos. Even though the size of bamboos and columns are different, the Size settings of the bamboos remain the same as those of the columns. (The X number was 1.2 and should be lower.)

After several rounds of trial and error, we learned to set the X number to 0.7. Now, it matches the width of the bamboos perfectly.

 Final Product

After 7 or 8 hours of work of three people, we finally localized and debugged the game. It looks pretty cool in Chinese now!