Localizing Strings in Daggerfall Unity – Part 1
Localizing Strings in Daggerfall Unity – Part 2
Localizing Strings in Daggerfall Unity – Part 3
Localizing Strings in Daggerfall Unity – Part 4
Localizing Strings in Daggerfall Unity – Part 5
Localizing Strings in Daggerfall Unity – Part 6
In this technical series, we’ll cover how to create a string localization mod for Daggerfall Unity then distribute it as a .dfmod file alongside built string assets.
The process of creating a string localization mod is similar to creating any other .dfmod for Daggerfall Unity, so parts of this tutorial will assume at least some familiarity with the Unity Engine and modding Daggerfall Unity in general.
If you get stuck with the basics of mod creation, please reach out to the wider modding community on our forums. There are dozens of experienced modders who are more than happy to share their knowledge and help you learn. And Unity has thousands of resources and communities online to learn more about the engine itself.
Throughout this series, please keep in mind that Daggerfall Unity is currently in Beta and the localization feature is considered to be in Preview. This feature will continue to expand through to 1.0 and beyond, and the information in this series is subject to change. Once localization is out of Preview, this tutorial series will be updated and included with the general modding documentation.
To get started, you will first need to download and install Unity 2019.4.10 (specifically this version) from the Unity Download Archive. The Unity Hub download is the easiest way to initiate this process.
Then you need to clone the full Daggerfall Unity source project from GitHub. You can just download a zip file of the source, but it’s recommended to fork Daggerfall Unity to your own GitHub repo so that you can collaborate with others and maintain your translation mod long-term. As Daggerfall Unity continues to grow and reach new versions, your mod will need to be kept up to date to remain compatible.
If you’re not overly familiar with git conventions and GitHub, using GitHub Desktop is the easiest way to get started.
Once you have Unity 2019.4.10 installed and the source project cloned locally, proceed to open the Daggerfall Unity project and we can begin.
Prepare Mod Folder Structure
The first step to creating any .dfmod is to prepare a folder structure to organise all the files your mod needs. In this tutorial, we’ll put everything inside the Assets/Game/Mods folder. Locate this folder in the Project view and create the folder hierarchy as shown below in blue.
Create New Locales
Daggerfall Unity ships with only the English (en) locale. To add strings for additional languages, we first need to generate additional locales.
You will probably only want to create a single translation for your mod, but for the purposes of this tutorial, we’re going to create multiple languages to gain a better understanding of how everything works together.
- Click Edit menu > Project Settings
- Select Localization
- Click Locale Generator
- Find and select the French (fr), German (de), Korean (ko), Czech (cs) locales
- Once these locales are selected, click the Generate Locales button
- Navigate to your prepared DemoTranslationMod/Assets/Locales folder and click Select Folder
You should now have the following languages displayed in the Localization window. If not, just click Locale Generator again and add the missing locales.
Then inside your mod’s Locales folder, you should see the following files. You’ll note that English (en) is not included, that’s because this locale is already part of the core game.
Create String Tables
Now that we’ve created our locales, we can generate new String Table Collections for translated text.
A string table is basically a text database where all strings in the game are held. Each string is uniquely identified by a key that remains the same across all locales. When the game needs to display a string to the player, it will lookup that key within the string tables for current locale.
In this tutorial, we’re going to create a custom English (en) translation to demonstrate that it’s also possible to change core text through the localization system.
- Window menu > Asset Management > Localization Tables
- Click New Table Collection
- Ensure all locales are selected
- Enter new Table Collection Name of Demo_Strings
- Click Create String Table Collection button
- Navigate to your prepared DemoTranslationMod/Assets/StringTables and click Select Folder
Repeat the above process to create a second set of string tables called Demo_RSC.
Once this is completed, you should see the following collection of files inside your DemoTranslationMod/Assets/StringTables folder.
You don’t need to be overly concerned about these files or how they work. Just having them present in the right folder is all that’s needed for now.
To open your string tables for editing, click Window menu > Asset Management > Localization Tables.
Use Selected Table Collection to select between your mod’s Demo_Strings and Demo_RSC string tables.
You’ll notice new string tables are all empty. This is where we get to the next step and import text from classic Daggerfall with all the right keys so we can begin writing translated text.
This will be covered in Localizing Strings in Daggerfall Unity – Part 2.