Daily free asset available! Did you claim yours today?
The cover for Unity Localization: Making Your Game Multilingual

Unity Localization: Making Your Game Multilingual

February 25, 2025

Introduction to Localization

Localizing your game? Expect a 15-20% increase in downloads, a surge in positive player reviews, and a corresponding bump in revenue. Here’s how Unity makes it happen. If you’re looking for a way to expedite your game development, consider using Wayline.

Unity Localization Package Interface The Localization Editor window simplifies managing locales and their associated string variations.

Introduction to Unity Localization

Why is localization important? It expands your potential player base, improves player engagement, and increases revenue.

Overlooking localization limits your game’s reach to only those who speak the language it was originally developed in.

Photograph of a calm, blue ocean meeting a sandy beach, symbolizing the global reach of games.

Unity offers several localization approaches. The official Localization package is a robust solution. Third-party assets are also available if you want more specialized features. One crucial aspect of ensuring a smooth player experience across different regions is optimizing performance. Don’t forget to check out Unity Mobile Game Optimization Checklist for tips on how to maximize your game’s performance on mobile devices. For a wider selection of assets you can use for localization, check out Strafekit. Don’t forget to add some cool visual effects like Buto.

Key terminology includes locales (specific language and regional settings, e.g., en-US, es-ES), string tables (collections of localized strings organized by keys), and asset tables (similar to string tables but for other assets like textures and audio).

The official Unity Localization package offers solid, integrated tools. Third-party assets might provide specialized features or workflows.

Setting Up the Unity Localization Package

Install the official Localization package through the Package Manager.

Configure project settings by selecting the supported locales. Create locales for each language your game will support (e.g., English, Spanish, French).

Photograph of a bustling marketplace in a foreign country, illustrating the diversity of languages and cultures

Pick a default language. This is the one players see if their language isn’t supported.

Working with String Tables and Localized Strings

String tables are key for wrangling your translated text. Create a string table for each group of related strings. Add localized strings to each table, providing translations for each locale.

Think of string keys as nicknames for your text. Instead of typing out ‘Hello World’ every time, just use Localization.GetString("hello_world"). It’s cleaner!

using UnityEngine.Localization;

Debug.Log(Localization.GetString("hello_world"));

String formatting is important for dynamic text. Use placeholders like {0} in your strings and replace them with values at runtime: string.Format(LocalizedString.GetLocalizedString("greeting"), playerName);

string playerName = "Alice";
string greeting = string.Format(LocalizedString.GetLocalizedString("greeting"), playerName);
Debug.Log(greeting); // Output: Hello, Alice! (or the localized equivalent)

Pluralization rules vary across languages, so use the Localization package’s pluralization features to handle this correctly.

Localizing UI Elements

TextMeshPro is the recommended solution for text rendering in Unity. To localize TextMeshPro text, bind the text component to a localized string. TextMeshPro automatically displays the correct translation based on the player’s selected language.

Photograph of a close-up of a multilingual sign in a train station, highlighting different writing systems

Different languages require different amounts of space. Adjust UI layouts for varying text lengths. Use flexible layouts and auto-sizing text boxes.

Localizing Assets (Textures, Audio, etc.)

Asset tables manage localized assets like textures and audio. Implement texture and audio swaps based on the current locale.

For example, character clothing or environment textures can reflect cultural differences. Similarly, audio cues or voiceovers can match the selected locale.

Localized fonts are crucial for displaying text correctly. Ensure your font supports all the characters required for the target languages.

Photograph of a lush, green forest with sunlight filtering through the leaves, representing the diverse environments where games are played

When localizing video content, consider dubbing or subtitles.

Scripting and Dynamic Localization

Access localized strings and assets from C# scripts using the Localization package’s API.

Dynamically change the game’s locale at runtime to allow players to switch languages. Implement an in-game language selection menu to allow players to choose their preferred language. Store user preferences for language settings using PlayerPrefs.

Testing and Debugging Localization

The Localization Preview window helps preview localized content in the editor. Implement automated localization tests to catch errors early.

Common localization errors include missing translations, incorrect string formatting, and UI layout issues. Rigorously test your game with each supported locale to uncover any hidden bugs! Special attention should be given to right-to-left languages, ensuring correct display.

Integrating with Localization Service Providers (LSPs)

Using professional translation services ensures high-quality translations. Several Unity Asset Store packages facilitate LSP integration.

The typical workflow involves exporting localization data, sending it to the LSP for translation, and then importing the translated data back into your project.

Consider translation costs when planning your localization budget.

Advanced Localization Techniques

Handling right-to-left languages requires special considerations. Ensure your UI and text rendering support right-to-left layouts.

Photograph of a serene mountain landscape at sunrise, showcasing a vast valley and colorful sky

Localize dates, numbers, and currencies according to regional formats. Be aware of cultural considerations beyond language, such as symbols and colors. Context-aware localization adapts translations based on the surrounding context.

Performance Considerations for Localized Games

Optimize asset loading for different locales to minimize loading times. Minimize memory usage with localized data by using efficient data structures and compression techniques. Implement strategies for efficient string table management. Profile localization performance to identify and address bottlenecks. If you’re utilizing UI elements extensively, be sure to also explore Unity UI Best Practices for Performance to ensure a smooth and responsive user experience, regardless of the chosen language.

Start by installing the Localization package today and unlock your game’s global potential!