![](https://zwang.middcreate.net/wp-content/uploads/2023/12/Unity-logo-1024x576.png)
Localizing a Chinese Wuxia RPG
Copyright Disclaimer: under section 107 of the Copyright Act of 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education, and research. This project is a proof-of-concept, and as such does not represent nor infringe on the creator(s) in any way.
This blog intends to explore the practice of game localization in Unity. The selected game is based on an open-source RPG game 《群侠传,启动!》, which is sourced from GitHub, with the authorization from the Jynew production team.
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/image-6.png)
《群侠传,启动!》is an open-source Wuxia RPG game framework that aims to pay tribute to the classic game “Heroes of Jin Yong”, as well as to provide a platform for secondary creations.
Language
The game is developed in simplified Chinese environment, with all strings written in simplified Chinese. The goal is to localize every string into English (The United States), including texts embedded in Sprites.
Workflow Overview
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/MicrosoftTeams-image.png)
Demo Video
Below is a demo video of the game in simplified Chinese:
Project Configuration
A problem that occurred when I was trying to open the project in Unity was that no XLua script was generated, which caused errors when loading the MODs. The way I resolved this is by using the Xlua tab at the banner to generate the script manually.
Introducing Unity Localization Packages
Unity supports localization implementation by offering a specialized plugin, which use the Localization package to configure localization settings for the application. The supported features include String localization, Asset localization and Pseudo-localization. More information can be found here.
Since the Unity engine used for this project is Unity 2020.3.32f1c1, a localization package must be imported first to enable the localization feature, which can be achieved by typing in com.unity.localization under “Add package from git URL” in the Package Manager.
In Unity, under the Asset Management of the Window’s tab, a localization table needs to be generated first to collect strings.
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/image-1024x130.png)
Implementing Localization
The localization implementation has two parts, in this case, they are String localization and Sprite Localization. Before conducting any localizing, it is crucial to identify what assets need to be localized, for example, the game’s logo, text on the main menu, etc. Then, locating the game objects or the scenes that contain those assets. This step is what I considered to be quite challenging, as the game used a lot of DontDestroyOnLoad objects to jump among different scenes, which made it difficult to locate the root objects that contain the to-be-localized assets. The silly method I used was to find the possible objects’ names in the hierarchy and look them up in the projects. Fortunately, I managed to identify most of the game objects in this game.
String Localization
After identifying the game object, it is time to add the “Localization String Events” to the components of that object. Here I can select the table of localization strings created earlier. By adding a new entry, a reference between the source string and the translation is created. A nice feature here is that the localized string table can be exported to a TMS like Phrase, where all strings can be translated at once. To enable the localization changes I made to the text, I have to add a list in the Update Strings section, where I can select the strings to be localized as objects and add a text function to them to display the translations at runtime.
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/image-2-1024x552.png)
Text Truncation Issues
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/Picture2.png)
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/Picture1.png)
Simplified Chinese is often considered a contracted language compared to English. Therefore, when translating from Chinese to English, the text tends to expand by 10% to 55%. One way to solve this problem is to modify the font size of the translation in the localization string table.
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/image-4.png)
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/image-5.png)
Sprite Localization
To localize the texts in an image, I used Adobe Photoshop to implement translations, and export the image as PNG. Just like how I created the string table, a localization asset table needs to be created first. Then, at the same place where I added the component, I added “Localize Sprite Event” to the object. Make sure to import the localized sprite right as “2D Sprite”, otherwise it won’t work with the event.
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/Picture3-1.png)
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/Picture4-1.png)
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/Picture6-1.png)
![](https://zwang.middcreate.net/wp-content/uploads/2023/12/Picture5-1-1024x502.png)
Demo of the Localized Game
Conclusion
The localization packages in Unity definitely lighten up the work of localizers, which also opens up the possibility of more local Chinese games being localized and discovered by more people.