[TUTORIAL] How to translate Unity games using UABEA
# Info #
In this tutorial you will learn how to deal with translating games on Unity engine.
After following all steps you will be able to export assets from Unity games, make changes and then import them back using UABEA.
You should know that method shown here is not the only one available.
Each game may have an unique way of storing texts,fonts and other assets, so not every game is easy to translate. Keep that in mind!
Here you’ll find a description of basic translating method using UABEA program. This will be guide for beginner users, so every step will be nice and easy.
As an example I’m going to translate a few lines of an example game – „The Escapists 2” on PC/Steam. Let’s assume that the game is installed in the standard Steam directory:
„C:\Program Files (x86)\Steam\steamapps\common\The escapists 2”
For use of this tutorial we will try to replace this text in game:
which occurs at the start of the game before launching a first mission.
So if you’re going to search for some text, you can type in something like „optional holding centre”, because it is very specific and it occurs only in one place in the whole game.
Now let’s start. First please do prerequisites steps as they are needed to deal with assets later.
# Prerequisites Steps #
1. Search for text using method from this tutorial https://ikskoks.pl/searching-text-strings-using-total-commander/ Use the main directory of the game as a base for searching.
2. Download UABEA from this link https://github.com/nesrak1/UABEA
a ) In cases of any issues with the program, download the latest „nightly” version of UABEA instead of a standard release!
b) Double click on „UABEAvalonia.exe” to run the program
# Extracting Texts / Importing Texts #
Using search method from prerequisites step, you know that text is stored in „resources.assets” file.
You can open this file in UABEA:
1. Click File > Open (CTRL+O) in UABEA.
2. Search for „resources.assets” file on your hard drive. It should be in „..\ The escapists 2\TheEscapists2_Data” directory.
3. You will see „Assets Info” windows on your screen:
4. Now you can select all assets with CTRL+A shortcut and click „Export Dump”
5. Use total commander method https://ikskoks.pl/searching-text-strings-using-total-commander/ to search for text strings once again, but this time in the directory with extracted raw files e.g. In „..\ The escapists 2\TheEscapists2_Data\out2” directory.
6. You will find out that texts are stored in „Localization-resources.assets-1867.dat” file after extraction.
7. Now you can go back to „Assets Info” window and you can find files with „Localization” in the name:
8. Select all text assets with „Localization” word in the name (using Shift button on your keyboard) and go to Plugins > Export.txt” > OK
9. Use total commander method once again on new export directory and you will find out that text you searched for is in the file „Localization-resources.assets-1867.txt”
From this moment you can be sure now that text is stored in main Localization text asset:
10. Now you can use Notepad++ to open this file and search for text.
For this example I will replace „optional holding centre” with polish word „więzienie”
11. You can save the file now and do the import. Select the Localization asset in the „Assets Info” window
12. And then go to Plugins > Import.txt > OK
13. Go to File > Save.
14. In the main UABEA window go to File > Save
Note: Remember to save data in „Assets Info” window first and then save it again in main UABEA window! It is important to do this in that order, otherwise you can have problems with seeing changes in the game!
15. Close UABEA.
16. Launch „The Escapists 2” game to see the changes
You can see that text has been changed successfully 🙂
And that’s it. You have translated your first sentence in Unity game. Now you can try to find fonts/graphics in the game and replace them using UABEA method as well.
I’ll consider enhancing this tutorial in the future if there will still be some problems with understanding this method.
EDIT – 18.06.2024
On a special request from one of the ResHax forum members, I’ve decided to add new section about font editing below
# Font Editing #
Editing fonts in Unity games using UABEA is very similar to text editing from previous sections.
First, you need to find font in the game files. In most cases, asset file storing font data has word „font” in it (somewhere in the binary data of the asset), so you can start with total commander method https://ikskoks.pl/searching-text-strings-using-total-commander/ to find files containing this word.
Following „The Escapists 2” example from previous sections, you can search like this:
and you’ll find few files. The main game font we are looking for is in the file .\TheEscapists2_Data\StreamingAssets\Windows\AssetBundles\fonts.dynamic
It may look like a custom file, but in reality it is a UnityFS archive bundle which can be opened with UABEA without issues.
So proceed like this:
1. Open UABEA
2. Click File > Open (CTRL+O) in UABEA.
3. Select „fonts.dynamic” file.
4. Click „Info” button in the main UABEA window. You should see this:
5. Now select second entry. It’s TTF font stored inside bundle file.
6. Click „Plugins” button
7. Click „Export .ttf/.otf” option from the menu.
8. Select directory where you want to save tour TTF font and click „Save” button.
9. Now you need to edit your font. You can do it for example with High-Logic Font Creator program. (more info in this tutorial https://ikskoks.pl/poradnik-8-edycja-czcionek-w-formacie-ttf-oraz-dds/)
10. For this example I’ve edited the few first letters of the font „a b c d e f g” to be upside down:
11. After editing the font, you should save it in Font Creator.
12. Now this new edited font needs to be imported to UABEA. Once again click „Plugins” button.
13. Now click „Import .ttf/.otf” option and select new TTF file from your hard drive.
14. Click „OK” to save changes.
15. Click File > Save in the „Assets Info” window.
16. Click File > Save in main UABEA window.
17. Now launch the game and test your changes.
As you can see, some letters are upside down in game, so font has been edited successfully. 🙂
>>Now you can try to find fonts/graphics in the game and replace them using UABEA method as well.
try to make tutorial about changing fonts in game
Hi, tnx for this one
Can you show us how to change the fonts now?
Hi. Sure, I’ll try to update tutorial.
Hej mam problem.
Przy próbie wyciągnięcia z Pliku zasobu „resources.assets” za pomocą Export Dump (wyjaśnienie poniżej) zawierającego tekst do tłumaczenia, pojawia mi się komunikat błędu „MonoBehaviour template info failed to load. MonoBehaviour assets will not be fully deserialized.”.
Co śmieszniejsze komunikat zaczął się pojawiać po próbie zaimportowania wprowadzonych zmian.
Wcześniej eksportował tekst do postaci Json bez problemu, co jeszcze dziwniejsze „Import Raw” wyciąga dane prawidłowo jednak ich edycja odpada.
Próbowałem korzystać zgodnie z twoim poradnikiem ale niestety po kliknięciu „Plugins” pojawia mi się puste okienko bez możliwości wyboru.
Wygląda to tak jakby UABEA zapisało sobie gdzieś jakieś śmieci i wczytuje je za każdym uruchomieniem, tak jak pamięta ostatnio używany folder, mimo zmiany lokalizacji z której program jest uruchomiony .
Hej. A jaka gra i platforma?
Korzystasz z UABEA w wersji „nightly”?
Warto wyciągnąć sobie oryginalny JSON i porównać oba pliki w Notepad++ (wtyczka „Compare”), żeby sprawdzić, czy na pewno nie ma tam żadnych różnic psujących jsona.
Gra Pharaon A New Era.
Problem w tym, że UEABA nie widzi mi żadnych wtyczek. Korzystam z wersji z dnia Apr 19, 2023.
Nie mniej chyba tymczasowo udało się rozwiązać problem.
Problem był chyba związany z tym, że próbowałem wyciągnąć dane do tłumaczenia z kopi pliku umieszczonej w innym folderze, a nie folderze gry.
Chyba gdzieś przegapiłem informację, że plik musi się znajdować w folderze gry, dlatego „bezpieczne podejście” do pracy z plikiem na jego kopii.