Featured Weblog | A developer’s information to efficient localization in Unreal Engine


Introduction

Localization is likely one of the most crucial but typically underestimated points of recreation growth. As world audiences develop, gamers count on to expertise video games of their native language, making efficient localization a necessity, not a luxurious. Nonetheless, it is far more than simply translating textual content—it entails addressing technical challenges, cultural nuances, and workflow optimizations to make sure a clean and seamless expertise throughout a number of languages.

On this article, I’ll stroll you thru the complexities of localization in Unreal Engine, sharing insights primarily based on my expertise with Wizard of Legend 2. From gathering and managing textual content to overcoming points like incorrect formatting, gender-specific language, and font dealing with, I’ll spotlight key areas that may trigger delays and how you can mitigate them.

This isn’t an introductory article, so I count on you to be acquainted with Unreal’s primary localization instruments. For those who’re new to the topic, sources under are nice to study the fundamentals. When you’re prepared, let’s dive into the real-world challenges and finest practices that will help you plan your localization course of extra successfully.

Gathering textual content

Gathering textual content is easy. Open the Localization Dashboard, press the “Collect Textual content” button, and voilà, it is executed!

Nonetheless, there are two main issues that may take up a major quantity of your time:

1. Irrelevant Texts

Unreal gathers many irrelevant texts. In our case, about 80% of the textual content that appeared within the gathering outcomes was irrelevant. These appeared supposed for engine localization, not recreation content material, however they appeared whatever the filter preferences set.

To deal with this, you might want to filter the places the place your collect textual content command seems to be for textual content. On the later phases of growth, this could be a daunting process, and it’s difficult to make sure that your filters cowl your entire recreation content material.

2. Incorrect Textual content Sorts

One other frequent subject is encountering many texts with the flawed sort. In Unreal, each localizable textual content must be of sort FText, however builders typically use FString as a substitute. Worse, they could use FText initially however later change its worth utilizing FString—which is simple to do, as changing between FText and FString may be very simple.

It’s a good suggestion to familiarize your complete workforce with localization ideas in Unreal from the beginning and assign somebody to oversee the localization course of. It’s best to periodically run the “Collect Textual content” command and make sure that your filters cowl the vast majority of your texts. As your undertaking grows in measurement, it turns into a lot tougher to seek out the texts that want localization.

Later, I’ll clarify how you can automate your pipeline in order that AI can translate your texts into different languages, permitting your QA workforce to identify unlocalized textual content whereas testing the sport in a unique language.

FText vs FString Hell

For those who’ve watched the tutorials talked about earlier, you recognize that changing FString to FText (or vice versa) is a foul concept. However it’s really easy to try this I need to remind you once more!

We had some circumstances the place FText was forged to FString, handed to a perform, after which forged again to FText contained in the perform. The textual content seemed to be a daily FText except you tried to entry its authentic string or despatched it over the community to a consumer with a unique language.

Casting from FString to FText can also be robotically executed by the Blueprint system for those who change the kind of your textual content from FString to FText or vice versa. So, control these conversions and repair them as quickly as you notice one.

There are a number of circumstances the place casting FString to FText is smart (e.g., printing debug textual content on the display), however on the whole, it’s a crimson flag.

Human languages are a multitude!

We determined to introduce gender customization very late in growth. From a gameplay perspective, it appeared easy: create a feminine mannequin, add a UI to let the participant select the wizard’s gender. Carried out, proper? Sadly, no!

Some languages, like Persian and Kurdish, are gender-neutral, however others, like French and Spanish, aren’t. The introduction of gender customization pressured us to retranslate each sentence involving our character, since its gender was decided at runtime, and the textual content additionally needed to be dynamically crafted primarily based on the gender.[1] 

Unreal already helps the {var}|gender(masculine, female, neuter) assemble. For those who move ETextGender to the var parameter within the FormatText perform, it really works completely. Nonetheless, we didn’t use this characteristic.

Our growth language was English, which is essentially gender-neutral. However to assist gender utilizing Unreal’s assemble, we might have needed to outline a {var} for gender in all our texts. This could have allowed us to move ETextGender to the FormatText perform, which different languages may use if wanted. This method is simple to neglect, and implementing it late in growth requires vital effort.

As a substitute, I wrote a customized assemble that could possibly be absent within the authentic textual content, and carried out a processor that would parse the assemble and choose the proper string primarily based on the character’s gender. This allowed our English textual content to stay clear. The assemble may be very  just like the Unreal assemble [masculine|feminine]

Moreover, this assemble is versatile. Though we didn’t want it, you might introduce a header like [header: masculine|feminine|neuter] to assist completely different genders for the speaker and goal.

One other subject you’ll want to handle is pluralization and singular kinds. I encourage you to make use of Unreal’s {quantity} {quantity}|plural(one=,few=,many=,different=) assemble.

Sure languages could current different challenges. For instance, in Turkish, the p.c image comes earlier than the quantity (e.g., %5 as a substitute of 5%). Moreover, textual content highlighting won’t work in languages like Chinese language, the place phrases aren’t separated by areas. These points are tough to identify, so allocate time to deal with them.

Fonts

Dealing with fonts for various languages could be a actual headache.

You is perhaps tempted to create a single font that helps all of the languages in your recreation. This isn’t a good suggestion as a result of, for instance, the font used for Chinese language may overlap with the English font, and merging them may create inconsistencies. Even for those who handle to separate the fonts cleanly, there’s a restrict to the variety of glyphs a font can assist.

One other method is to make use of Unreals asset localization, creating localized variations of your font asset. Sadly, this method has its personal drawbacks. While you change the sport’s language, in-game texts change instantly, however Unreal solely hundreds the localized font property when the sport is restarted. This leads to gamers seeing query marks till they restart the sport or change again to the unique language.

A greater resolution is to make use of Unreal’s font handler characteristic, which lets you select a particular font primarily based on the present locale. Whereas this works, it isn’t best. For instance, within the settings menu, you may need to show every language’s identify each within the present language and in its native script (e.g., “Farsi (فارسی)”). If the font is simply chosen primarily based on the locale, you both should assist Persian letters in all of your fonts otherwise you’ll see query marks.

What’s one of the best method?

The method I discovered finest is to make use of Unicode ranges and assign every font to a particular vary.

Our default font coated all European languages, however Chinese language and Japanese have been tougher. Because the Unicode vary for Kanji characters is blended, and simplified Chinese language, conventional Chinese language, and Japanese all use the identical vary, it was unimaginable to have separate fonts for every language. We tried numerous fonts, a few of which promised to assist each Chinese language and Japanese, however once we examined them, we discovered lacking characters. Some fonts have been acceptable, however Chinese language customers discovered them unreadable. Ultimately, the translators got here to the rescue and supplied me with the hyperlink under, which affords commonplace Chinese language fonts: https://github.com/wordshub/free-font.

Translation pipeline

Working with a translation workforce is a difficult administration and software program growth process.

As a programmer, you might want to create a pipeline that facilitates communication between your workforce and the interpretation workforce. Since every workforce’s construction is completely different, I received’t go into specifics, however I’ll supply some basic recommendation.

Before everything, perceive the software program your translation workforce is utilizing. Be sure that encoding is constant all through the pipeline. If not, chances are you’ll encounter points like numbers displaying up as a substitute of carriage returns or beforehand translated texts turning into corrupted. A great rule of thumb is to deal with the conversion your self. For instance, in the event that they’re utilizing Excel, give them Excel recordsdata as a substitute of CSVs (particularly since Microsoft Excel doesn’t ask for encoding when importing CSVs!). Relying in your workflow, you may want to put in writing some converters and even create your personal format (e.g., for versioning or tagging).

The perfect workflow is to supply the interpretation workforce with a single file and retrieve the identical file after translation. Nonetheless, since translation deadlines are often earlier than the discharge date, some content material won’t be prepared. In such circumstances, you need to use string tables: write the texts in there and as soon as the content material is prepared, you possibly can reference the string desk for the localized textual content. Nonetheless, as translation progresses, your workforce may notice they missed some texts, and also you may want to supply extra recordsdata. The way you handle a number of recordsdata will rely in your pipeline, however be ready for this.

Constructing a sturdy pipeline is time-consuming, and also you’ll doubtless have to refine it a number of instances, however it might considerably pace up the method.

You can begin by utilizing the instructions out there in Unreal’s Localization Dashboard. These could be simply referred to as in a Python script without having to open the engine. I’ve included a easy instance on the finish of the doc.

With these constructing blocks, you are able to do all types of fascinating issues. For instance, you might export your texts each night time, convert them, and add them robotically to your translation workforce. After the localization deadline, you possibly can regulate your merge pipeline to verify for phrase rely. If new textual content has been added, you possibly can stop the merge from continuing.

One other helpful utility is to collect all of your texts and use AI translation companies to translate them, then have your inner QA workforce take a look at the sport and establish unlocalized texts earlier than you ship them to the interpretation workforce.

Lastly, notice that textual content compilation is not triggered whenever you construct the sport, so you may have to set off it manually—or higher but, configure your construct pipeline to name CompileText robotically.

Platform concerns

In case you are planning to publish your recreation on platforms like PlayStation and Xbox, bear in mind that {hardware}, software program, and ideas are referred to in another way throughout platforms. Platform house owners count on you to comply with their requirements in all of the languages you assist; in any other case, your recreation could also be rejected. For instance, you can not merely use the phrase “Controller” throughout all platforms. The time period “Controller” is named in another way on every platform, so your recreation ought to check with it in keeping with the platform-specific terminology.

You possibly can create a assemble that takes the present platform as a parameter and selects the suitable time period primarily based on the platform, or alternatively, you need to use completely different textual content for every platform.

It’s a good suggestion to create a desk of those phrases, alongside their anticipated translations in numerous languages for every platform, and supply it to your localization workforce early within the course of. Reviewing all of the texts afterward could be time-consuming and error-prone.

Conclusion

Localization could be difficult and time-consuming, and you might want to be ready for it. It’s an important a part of trendy recreation growth. Gamers count on to interact with video games of their native language, and failing to supply this at launch can result in destructive evaluations and missed alternatives. I hope this text has supplied beneficial insights into the challenges and options, and that it helps you method localization with a clearer understanding.

Good luck together with your localization efforts, and I want you nice success!



Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles