January 18, 2025
  • Home
  • Default
  • Mastering Localization in Unreal Engine: A Developer’s Guide to Global Game Design
A developer’s info to effective localization in Unreal Engine

Mastering Localization in Unreal Engine: A Developer’s Guide to Global Game Design

By on January 18, 2025 0 2 Views

“`html

Introduction

Localization is undeniably one of the most vital yet often overlooked aspects of game development. As global audiences expand, players seek to experience games in their native tongue, making effective localization a necessity rather than a luxury. However, it’s significantly more complex than just translating textual content—it encompasses addressing technical hurdles, cultural subtleties, and workflow enhancements to ensure a polished and seamless experience across multiple languages.

In this article, I will guide you through the intricacies of localization in Unreal Engine, sharing insights from my experience with Wizard of Story 2. From collecting and managing textual content to tackling issues such as improper formatting, gender-sensitive language, and font management, I will emphasize key areas that could potentially cause delays and strategies to alleviate them.

This is not a beginner’s article, so I encourage you to be familiar with Unreal’s core localization tools. If you’re new to the topic, the resources below are excellent for grasping the fundamentals. When you’re ready, let’s delve into the real-world challenges and best practices that can help you streamline your localization efforts.

  • Localization overview -This video series covers all the fundamental concepts necessary to navigate Unreal’s localization pipeline effectively.

Collecting textual content

Collecting textual content is straightforward. Open the Localization Dashboard, press the “Gather Text” button, and voilà, it’s done!

However, there are two main challenges that can consume a significant amount of your time:

1. Irrelevant Texts

Unreal collects many unrelated texts. In our case, approximately 80% of the textual content that appeared in the gathering results was irrelevant. These seemed intended for engine localization, not game content, yet they appeared regardless of the filter settings applied.

To combat this issue, you need to filter the areas where your own textual content appears to search for text. At the later stages of development, this is often a challenging task, and it’s crucial to ensure your filters encompass all game-related texts.

2. Incorrect Text Types

Another prevalent issue is encountering many texts with the wrong type. In Unreal, every localizable text must utilize the FText type, but developers frequently use FString instead. Even worse, they may start with FText but later switch its type to FString—which is easy to do, as the conversion between FText and FString is quite simple.

It’s wise to educate your entire team about localization techniques in Unreal from the beginning and assign someone to oversee the localization process. You should regularly run the “Gather Text” command to verify that your filters capture the majority of your texts. As your project increases in scale, identifying the texts that need localization becomes increasingly complex.

Later, I will demonstrate how to automate your pipeline so that AI can translate your texts into different languages, enabling your QA team to identify unlocalized text while testing the game in a different language.

FText vs FString Hell

If you have watched the tutorials mentioned earlier, you know that converting FString to FText (or vice versa) can be problematic. But it’s so simple to do that I feel compelled to remind everyone again!

We encountered some cases where FText was cast to FString, passed to a function, and then cast back to FText within that function. The text appeared to be a regular FText until you tried to access its original string or sent it over the network to a client using a different language.

Casting from FString to FText is also automatically conducted by the Blueprint system if you change the type of your text from FString to FText or the other way around. Thus, keep an eye on these conversions and rectify them as soon as you notice one.

There are a few instances where casting FString to FText is acceptable (e.g., when printing debug text on the screen), but generally, it’s a warning signal.

Human languages are messy!

We decided to implement gender customization quite late in development. From a gameplay perspective, it seemed simple: create a female character model, add a UI element to let the player choose the wizard’s gender. Done, right? Unfortunately, no!

Some languages, such as Persian and Kurdish, are gender-neutral, while others, like French and Spanish, are not. The incorporation of gender customization forced us to retranslate every sentence involving our character, as its gender was determined at runtime, and the text also needed to be dynamically tailored based on the gender.[1] 

Unreal already supports the {var}|gender(masculine, feminine,
“`neuter) secure. When you provide ETextGender to the var parameter within the FormatText feature, it operates flawlessly. Conversely, we didn’t utilize this functionality.

Our development language was initially English, which is primarily gender-neutral. However, to better support gender in Unreal’s secure, we would have needed to specify a {var} for gender in all our texts. This would have enabled us to pass ETextGender to the FormatText feature, which other languages might use if necessary. This method is easy to overlook, and integrating it late in the development process requires considerable effort.

As an alternative, I created a custom secure that could be absent from the regular text, and applied a processor that could interpret the secure and select the appropriate string based on the character’s gender. This kept our English text organized. The secure is very similar to the Unreal secure [masculine|feminine]

Moreover, this secure is adaptable. Even if we didn’t require it, you could introduce a header like [header: masculine|feminine|neuter] to accommodate various genders for both the speaker and the audience.

Another aspect you’ll need to address is pluralization and singular forms. I recommend using Unreal’s {amount} {amount}|plural(one=,few=,many=,other=) secure.

Certain languages may pose additional challenges. For instance, in Turkish, the percent symbol precedes the number (e.g., %5 instead of 5%). Furthermore, text highlighting might not function in languages like Chinese, where words are not separated by spaces. These issues can be tricky to resolve, so make sure to dedicate time to address them.

Fonts

Managing fonts for different languages can often be quite a hassle.

You may be inclined to choose a single font that can support all the languages in your game. This is not a great idea because, for example, the font used for Chinese might overlap with the English font, and merging them could lead to inconsistencies. Even if you manage to separate the fonts correctly, there is a limit to the number of glyphs any single font can support.

An alternative approach is to utilize Unreal’s asset localization, producing localized versions of your font asset. Unfortunately, this method has its own drawbacks. When the game’s language changes, in-game text updates immediately, but Unreal only loads the localized font resources when the game is restarted. This results in players seeing question marks until they restart the game or switch back to the original language.

A better solution is to use Unreal’s font handler feature, allowing you to select a specific font according to the current locale. While this does work, it’s not entirely effective. For example, in the settings menu, you would want to display the name of each language in both the current language and its native script (e.g., “Farsi (فارسی)”). If the font is only selected based on the locale, you either have to include Persian characters in all your fonts or end up with question marks.

What’s the best approach?

The method I found most intriguing is to utilize Unicode ranges and assign each font to a specific range.

Our default font covered all European languages, but Chinese and Japanese were more complex. Since the Unicode range for Kanji characters is shared among simplified Chinese, traditional Chinese, and Japanese, it was impossible to create separate fonts for each language. We tested several fonts, some of which claimed to support both Chinese and Japanese, but upon testing, we discovered missing characters. Some fonts were acceptable, but Chinese users found them difficult to read. Eventually, our translators came to the rescue and provided me with the link below, which offers standard Chinese fonts: https://github.com/wordshub/free-font.

Translation pipeline

Collaborating with a translation team can make for a challenging course of action in both management and application development.

As a programmer, you need to establish a pipeline that encourages interaction between your team and the translation team. Given the diversity of development between teams, I won’t delve into specifics, but I will share some general advice.

First, ensure that the application your translation team is using is well understood. Make sure that encoding is uniform throughout the pipeline. If it isn’t, you might encounter issues like numbers appearing instead of carriage returns or previously translated texts becoming corrupted. A helpful rule of thumb is to handle the conversion process yourself. For example,

Learn More

  Default
Leave a comment

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