LOCALIZATION SYSTEM - PART 1
Author: cevozby,
published 9 months ago,
For the past 3 weeks, I've been dealing with the localization system (aside from some minor updates and bug fixes). There are things that seem easy at first glance from the outside, and you might think you can handle them right away, but as you delve deeper, more work emerges. The localization system was like that. The reasons for such a workload include having a lot of text in the game, and some of it needing to change depending on the situation. Now let me tell you what I've been up to in these 3 weeks.
First of all, I had no idea about localization, but we prioritized it to provide a better experience for our players. While researching how to do it, I learned that Unity already has a localization system in place. This really made my job somewhat easier, but honestly, there weren't many resources available, so I struggled with some aspects.
Unity's localization system is really user-friendly at a basic level, and you can even connect it with Google Sheets so you can make AI translations into other languages (although this is generally not well received). Instead, after making AI translations, we reach out to someone fluent in that language for help (if you'd like to help us, please contact us).
Now let's talk a bit more about the technical aspects. How does Unity's localization system work?
You create a table and input the languages you want to translate into. Then you specify a key for the text you want to translate, and then you make the translations for that text.
[img]https://clan.cloudflare.steamstatic.com/images//44297973/41345735ec7267e145bb9f74d25b1e064f26ad2f.png[/img]
Translating static text is easy, but dynamic text is not so straightforward. So, what happens with dynamic text? Static text in the game remains constant and unchanged throughout the game, such as button labels on the start screen (New Game, Load Game, etc.). Dynamic text, on the other hand, are text elements added to the game later and whose values can change (we're getting into the parts that gave me a hard time here). For example, I can mention the Leaders we create in our game; these leaders are generated randomly each time, so making translations for them statically is not feasible. At the same time, since their names are proper nouns, they shouldn't be translated, but their nicknames should be.
[img]https://clan.cloudflare.steamstatic.com/images//44297973/c9c27f5dbf252b78f053f833c87e80181969aac8.gif[/img]
[img]https://clan.cloudflare.steamstatic.com/images//44297973/c6575ee7e58b298e74126307fa82a92c36549afd.gif[/img]
We have a lot of such text in our game. Although I've managed to handle some of them, there are still parts I haven't figured out yet. One of these is the Inbox system, which took up most of my time.
The reason for this is that while I provide an input when creating other texts, and they load along with their translations, I keep the texts in the Inbox as data. So, I need to save them in this way when saving them, which proved to be quite challenging, but don't worry, I'll try to resolve it very soon.