[LOCALIZATION] How to translate ALL your content in just ONE big file (Steam Workshop)

Hello everyone,

I’m Erayser from Phoenix Interactive (Stargate Space Conflict, Mass Effect: Reborn and Battlestar Galactica: Fleet Commander with the HW2BSG Team).

I’ve been working for a long time now on the user interface of our remastered versions, coming January 2020. And thus far I’m sure we’ve all had issues with localization and translations. Since 2015 I solved a big issue regarding the UI and other content by just giving the good coordinates for content inside LUA files, with locale numbers.

What I mean is, basically some files can’t be translated, or at least, not loaded the same way. Now, with this solution, this will help you release just one version with all your languages.

INTRODUCTION
As an example, let’s say you have one background for your main menu, and you have graphic buttons and your main background in different languages. You could say that you’ll have to make a choice with just one language – or release multiple versions on the Steam Workshop.

Now, that issue will be fixed on your side, and I thought it would be a great thing to share it with you here. Basically, here’s the way it works:

FIRST STEP
Let’s say you have a Background TGA with text on it. But, guess what you have 4 versions of it (english, french, spanish and german). Instead of giving the proper coordinates of your file, you just need to add a localization number for it, and here’s the way:

In your locale folder, you should find 4 sub-folders, named english, french, spanish, german. If you don’t have them yet, you can create them and then add the language locale file (LUA). Now, let’s create a new sub-folder, located in the language folder, and that one will be named “ART” or anything you want. Go to mainmenu LUA, and check for the background line. Once you’re there, you should find something like this:

BackgroundGraphic = {
                    type = "Graphic",
                    --size = {3840, 2160},
                    --textureUV = { 0, 0, 3840, 2160},
                    uvRect = { 0, 1, 1, 0 },
                    texture = "Data:UI\\NewUI\\Background\\main_bg.tga",  },

As you can see, you have the following texture coordinates: “Data:UI\NewUI\Background\main_bg.tga”

SECOND
Now, we will just change these coordinates and replace them with a $XXXX number, that refers to a line in your locale file. Once you’ve saved this file, and opened the locale one, you’ll have to give the proper coordinates. That will look something like this. FYI, 9999 is just a random number, choose the one that fits your locale file.

9999       Data:LOCALE\\FRENCH\\ART\\BACKGROUND\\main_bg.tga

With such a system your mod will automatically load the proper file, and it will never result in a crash. For all graphic content, that’s how it works. And this will let you make just one big localization for your mod, instead of publishing multiple versions on the Steam workshop (as an example). The same goes for audio files and more…

I hope this tutorial will help you guys! If you didn’t know, I’m glad to help. If you did, well it will surely help others.

Anyway, if you have any questions or need more info, feel free to ask!

2 Likes