Daggerfall Unity 0.10.26 Localization Preview
Posted: Fri Jul 24, 2020 1:30 am
Daggerfall Unity 0.10.26 Localization Preview will be available in a couple of weeks. This version introduces back-end features required to support translation mods. For more detail and upcoming tutorials, please refer to the topic in Translations forum below (under construction).
viewtopic.php?f=26&t=3919
Rather than go over all that in two places, I want to quickly summarise changes that might impact core developers now. This all relates to text in the base game so probably won't affect modders, but worth taking a quick look below just in case. End users don't need to do anything special, please just report missing or broken text strings if you find any.
The following text sources have been removed:
This text has been moved into a Unity Localization StringTable called Internal_Strings.
I've exposed Localization system through the TextManager singleton and kept everything as similar as possible to use. For example, the below text lookup changes from:
Into:
The magic effect system required some refactoring to support switchable locales. Instead of caching text items like spell book description into a data struct at startup, this is now accessed as-needed from class Properties that each effect must implement. So instead of:
This becomes:
GetRSCTokens() method is now localization aware and can grab translated RSC text from a custom StringTable or fallback to TEXT.RSC. The default English game will continue using TEXT.RSC for a while yet. GetRSCTokens() is likely be moved into TextManager for consistency later.
I've already done the work of migrating everything in core game to StringTables and refactoring where needed. No work should be needed in mods unless you have some touch on the text sources listed above.
I recommend core devs take a look at the Unity Addressables and Localization stuff. There are a few gotchas when creating new local builds. I'll cover this in more detail in Translation topic in near future.
viewtopic.php?f=26&t=3919
Rather than go over all that in two places, I want to quickly summarise changes that might impact core developers now. This all relates to text in the base game so probably won't affect modders, but worth taking a quick look below just in case. End users don't need to do anything special, please just report missing or broken text strings if you find any.
The following text sources have been removed:
- HardStrings.cs hardcoded strings (now just storing some keys).
- ClassicEffects.txt
- ConversationText.txt
- DaggerfallUI.txt
- GeneralText.txt
- Races.txt
- SpellmakerUI.txt
- TextProvider.cs hardcoded strings (monster names, material names, skill names)
This text has been moved into a Unity Localization StringTable called Internal_Strings.
I've exposed Localization system through the TextManager singleton and kept everything as similar as possible to use. For example, the below text lookup changes from:
Code: Select all
TextManager.Instance.GetText("ClassicEffects", "elementalResistance");
Code: Select all
TextManager.Instance.GetLocalizedText("elementalResistance");
Code: Select all
properties.GroupName = TextManager.Instance.GetLocalizedText("climbing");
properties.SpellMakerDescription = DaggerfallUnity.Instance.TextProvider.GetRSCTokens(1578);
properties.SpellBookDescription = DaggerfallUnity.Instance.TextProvider.GetRSCTokens(1278);
Code: Select all
public override string GroupName => TextManager.Instance.GetLocalizedText("climbing");
public override TextFile.Token[] SpellMakerDescription => DaggerfallUnity.Instance.TextProvider.GetRSCTokens(1578);
public override TextFile.Token[] SpellBookDescription => DaggerfallUnity.Instance.TextProvider.GetRSCTokens(1278);
I've already done the work of migrating everything in core game to StringTables and refactoring where needed. No work should be needed in mods unless you have some touch on the text sources listed above.
I recommend core devs take a look at the Unity Addressables and Localization stuff. There are a few gotchas when creating new local builds. I'll cover this in more detail in Translation topic in near future.