Phrase and beyond Software localization

Localizing Unity games with the official Phrase plugin

Want to localize your Unity game without the CSV chaos? Discover how the official Phrase Strings Unity plugin simplifies your game’s localization workflow—from string table setup to pulling translations directly into your project. Whether you’re building for German, Serbian, or beyond, this guide shows how to get started fast and localize like a pro.

Gaming is global. Depending on which stats you read, between 2.6 billion and 3.3 billion people play video games worldwide. As of 2023, the gaming market in China alone was $82.06 billion dollars, with non-English speaking countries representing some of the highest concentrations of gamers worldwide.

That means localization is no longer a nice-to-have if you want to build your game’s reach and revenue potential. And if you’re a Unity developer, we like to think that the best way to make your games available in players’ local languages is to use the Phrase Strings Unity Localization plugin.

Here, we’ll show you the fundamentals of working with Phrase Strings and Unity.

What problem are we solving here?

Before we get into the nuts and bolts, let’s look at the localization challenges this plugin solves.

As its name suggests, Phrase Strings is the part of the Phrase Localization Platform that helps you manage localized versions of the various text strings that make up your game’s UI. As a Unity Verified Solution, our new plugin has been built to Unity’s highest quality and compatibility standards.

If you’ve localized a Unity project previously, there’s a good chance you ended up with a bunch of spreadsheets, lots of to and fro, and a manual process for importing CSV files back into Unity’s String Tables, only to discover formatting issues and text overflow problems during gameplay testing.

Using the Phrase Strings Unity plugin, the workflow becomes more automated and predictable:

  • You create, approve, and otherwise manage translations in the Phrase platform.
  • Your String Tables connect directly to Phrase Strings through the plugin
  • You can push source text to Phrase with a single click from within Unity
  • And then pull completed translations directly into your Unity project when ready

So, how do you get started with the Phrase Strings Unity plugin?

Starting out with Phrase Strings and Unity

Note: For the purposes of this introduction we’ll use Unity’s Endless Runner sample game. If you don’t have that already, download and open it in Unity Editor.

Phrase’s Unity plugin relies on the Unity Localization package and, in particular, its String Table Collections. So, the next step is to install Unity Localization.

If you’re already experienced with Unity then this is pretty straightforward but to a newcomer it can be a little overwhelming as there are several different ways to install Unity packages. Thankfully, the Localization package is available in Unity’s official package registry.

  1. Open the Window top menu and then select Package Manager.
  2. Click the icon on the left and you’ll be able to search the Unity Registry.
  3. Search for “localization”.
  4. Hit “Install” when you find the right package (hint: it should be the only result, at the time of writing). As you might expect, the package will install on your machine.

Now the package is installed, we need to initialize localization in our project. 

In the Edit top-level menu, click Project Settings and then navigate to the Localization section of the settings panel.

Hit the Create button and then save your settings file.

If you’re organizing your Unity project by asset type, you might want to create a Localization folder to keep your settings assets file, as well as future localization assets we’ll be creating. But if you’re just experimenting for now, you can save your settings in the Assets folder.

Localization is now activated in the project but there’s more we need to do.

Add the locales you want to support

We need to tell Unity which locales, or languages, we want to support in the game.

Click Add Locale and you’ll see a list of locales you can select from.

There’s no pressure to choose all the locales you want to support at this stage. As you’re using Phrase Strings, rather than a bunch of Excel sheets, adding locales is pretty much as easy as selecting them here, completing the translations in the Phrase platform, and then pushing those translated strings back into the Unity project.

For now, we’ll select English, German, and the Latin alphabet variant of Serbian.

Setting a default for when we don’t support the user’s preferred locale

It’s worth taking a moment to talk about how locale fallback mechanisms work. 

Serbian is a great example of the potential for complexity here. Serbian can use both Cyrillic and Latin alphabets.

Cyrillic is the official script in Serbia but Latin is also widely used. Serbian also has several regional dialects (Šumadija-Vojvodina, Kosovo-Resava, and others) and pronunciation variants (Ekavian and Ijekavian).

By implementing the Latin script version of Serbian (sr-Latn), we’ll accommodate users of all Latin-based Serbian variants.

Even if their locale is set to a variant, Unity will serve them with the sr-Latn as a default fallback. However, that’s not necessarily true for people whose systems are set to the Cyrillic version of Serbian (sr-Cyrl).

If their system is set to fall back to the Latin script, they will see that locale but otherwise they’d see the project’s default locale.

So far, we’ve selected three locales out of the hundreds officially supported by Unity’s Localization plugin. So, we need to set a default locale for the millions of people whose preferred locales we don’t plan to support.

Towards the bottom of the modal, you can specify that default from the list of locales we just selected.

Specifying which locale to use

Unity Localization also lets us choose how to select which locale to use at game load time. There are several different methods, including:

  • A locale specified as a command line argument
  • The locale provided by the user’s system
  • A fallback other than the project’s default locale.

You can probably stick with the default order, unless you have a strong preference for something else.

Set up the string tables

Unity manages localization strings in String Tables. Each locale has its own table containing key-value pairs. The key is what you reference in your UI code, and the value is the actual localized text for that language.

Before we connect Phrase to Unity, we need to set up those String Tables.

In the Window top level menu, select Asset Management and then Localization Tables. In the window that opens, you’ll see a message telling you that there are no tables.

We can fix that by clicking on the New Table Collection button. By default, all of our locales are selected so all we need to do is name the collection (something like “UI” will do for now) and then click Create and then save it in your Assets directory.

That leaves you with a blank table ready for your translations.

Let’s add a key ready to translate. Click New Entry and add the key:

Main/UICamera/Loadout/StartButton/Text

This will let us localize the button that starts the game in Endless Runner.

Now we need to replace the hardcoded string in the code. In this case, to change the text on the main screen’s Run! button we need to edit:

Scripts > GameManager > LoadoutState.cd

First, we need to call the Localization plugin:

using UnityEngine.Localization.Settings;

And then replace runButton.GetComponentInChildren<Text>().text = “Run!”; with:

runButton.GetComponentInChildren<Text>().text = LocalizationSettings.StringDatabase.GetLocalizedString(“UI”, “UI_RUN_BUTTON”);

We can preview that by running the game and changing the locale:

Install and connect the Phrase plugin

Now that we have localized a string, let’s hand the actual translation and string management work to Phrase. That starts with installing the Phrase Strings Unity plugin.

At the time of writing, the Phrase Strings plugin isn’t yet available in the Unity Asset Store. So, we’ll install it from the GitHub repo by cloning it into your project’s Packages > com.phrase.plugin directory.

Next we need to connect the Phrase plugin to Phrase Strings itself. This is a two step process.

First, create a Phrase Strings project for your Unity game. In your Phase Strings dashboard, click Add Project. Give your project a name and once it is created add the languages we’re working with in Unity: English, German, and Serbian (Latin).

Now that you have a project ready to work with you’ll need to get hold of an API key to connect the Phrase Unity plugin with your Phrase Strings account. Click your face in the top right corner and visit Profile > Settings > Access tokens.

The Generate Token button will lead you to a modal where you can generate the key.

After copying the key, head back over to Unity, where you need to visit Assets > Scripts > UI > Settings then click the Phrase icon. In the Inspector, add your API token and click Fetch Projects.

If all goes well, you’ll see the project you just created in the list and the languages that match between your Phrase Strings project and the Unity project.

We need to get the strings we created earlier (“Run!”, “Laufen!”, and “Trči!”) into Phrase Strings, so click Push to Phrase.

Make our first translation in Phrase

As it turns out, “Laufen!” might not be the best word to use for our game’s German players. “Rennen!” is closer to what we’re looking for, as that can mean to start a race.

In the Phrase Strings project, open the Endless Runner project and then visit the Languages tab. 

Click the Editor button for German and you’ll start to get a sense of how much Phrase Strings can help with the localization process, including automatic suggestions. For now, replace “Laufen!” with “Rennen!” and then hit Save.

Back in the Unity project, click Pull languages and make sure all three locales are selected, then click Pull to Unity to download the updated translation from Phrase Strings.

Once the import is complete, run the game and select the German locale to see our newly updated string in action.

Unity localization with Phrase Strings

By connecting the Unity Localization plugin to Phrase Strings you can streamline your localization workflow without the need for Google Sheets, Excel files, CSVs, and similar complications.

In this short introduction, we’ve only scratched the surface of how Phrase Strings can help you deliver improved localization with less work. For more, read our official guide to the Phrase-Unity integration.

Modern players demand immersive gameplay in their native language, but manual localization processes, siloed teams, and translation errors can cause delays and make it harder for you to reach a global audience effectively.

Phrase solves these problems by seamlessly integrating with Unity, automating workflows, and providing translators with precise context. This speeds up your time-to-market and ensures accurate, impactful translations.