Daggerfall Unity 0.10.26 Localization Preview

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
Post Reply
User avatar
Interkarma
Posts: 6131
Joined: Sun Mar 22, 2015 1:51 am

Daggerfall Unity 0.10.26 Localization Preview

Post by Interkarma »

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:
  • 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)
The above is a combination of hardcoded string literals in C# files and text tables in StreamingAssets/Text. It's basically all text from FALL.EXE and strings unique to DFU.

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");
Into:

Code: Select all

TextManager.Instance.GetLocalizedText("elementalResistance");
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:

Code: Select all

properties.GroupName = TextManager.Instance.GetLocalizedText("climbing");
properties.SpellMakerDescription = DaggerfallUnity.Instance.TextProvider.GetRSCTokens(1578);
properties.SpellBookDescription = DaggerfallUnity.Instance.TextProvider.GetRSCTokens(1278);
This becomes:

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);
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.

User avatar
Interkarma
Posts: 6131
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Unity 0.10.26 Localization Preview

Post by Interkarma »

Flagging another change that could impact mods, this time for potions. Rather than setting DisplayName of potion at startup, a new PotionRecipe now sets DisplayNameKey. This key is used to lookup potion name from active localization table as required. This fixes "Potion of <LocaleText-NotFound>" and allows for potion names translations to be switched at runtime.

The DisplayName property is retained for backwards compatibility. This now just looks up display name using the key above. If key is null or empty, then "Unknown Powers" is returned. Moved "Unknown Powers" text to localization string tables.

See link below for full PR with all changes.

https://github.com/Interkarma/daggerfal ... da66b2af92

User avatar
pango
Posts: 2833
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Daggerfall Unity 0.10.26 Localization Preview

Post by pango »

Hi Interkarma,

Any plans or ideas for making DialogShortcuts.txt overridable for localization purposes?
I imagine that a locale could come with several named layouts, based on different keyboard layouts or simply different keyboard shortcuts schemes, one of the layouts (say the first one) being the default...
But I don't know how that would fit in the localization implementation...
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Interkarma
Posts: 6131
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Unity 0.10.26 Localization Preview

Post by Interkarma »

Being in StreamingAssets, a translation mod could provide replacement shortcut files for users with various keyboard layouts.

We could also supply a method for a scripting mod to register a new bindings file at startup based on whatever conditions mod checks for. But users might also like to customise this one themselves, so a mod forcing new shortcuts isn't quite ideal either.

I don't feel this is a good candidate for compiled text assets, it's much more functional in plain text table format. It sits a bit oddly between localisation and user settings.

koreanfonter
Posts: 4
Joined: Sat Jan 16, 2021 5:35 am

Re: Daggerfall Unity 0.10.26 Localization Preview

Post by koreanfonter »

Hello. Trying to chat with Google Translate. I want to know how to replace SDF fonts using dfmod format. Do you have any manuals? I already tried and thought that I replaced the SDF font with a Korean font using the method of inheriting daggerfallfont.cs, but it doesn't work.
I am familiar with CJK fonts. So I am trying to localize daggerfall unity. There are groups in Korea that worship your work, and I am one of them. I want to tell Korea about your work, so I am trying to connect Korean language to daggerfall unity. I still don't understand everything about daggerfall unity and need your help.

User avatar
Interkarma
Posts: 6131
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Unity 0.10.26 Localization Preview

Post by Interkarma »

Hey there koreanfonter! :)

Please keep an eye on the below forum topic for tutorials creating translation mods using localization system. Future tutorials will include how to set new locale fonts along with text changes.

viewtopic.php?f=26&t=3919

I sincerely apologise to all our international friends waiting for further tutorials to cover more of this system. I've been allowing other priorities to take my time away from completing this tutorial series.

I hope the above translates well using Google Translate. If not, please don't hesitate to ask followup questions and I'll do my best to answer.

koreanfonter
Posts: 4
Joined: Sat Jan 16, 2021 5:35 am

Re: Daggerfall Unity 0.10.26 Localization Preview

Post by koreanfonter »

Thanks for the kind response, Interkarma.
Google Translate works very well.
I know you are busy. Allocate time first for your other goals.
Me and my Korean friends can wait for the tutorial. We can enjoy playing Daggerfall and wait.

User avatar
Interkarma
Posts: 6131
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Unity 0.10.26 Localization Preview

Post by Interkarma »

I'm back to working on localization again now. There are a few changes coming up that I'll summarise below.

I'm reworking localization tutorials into a series of posts on dfworkshop.net. The blog has become a bit stale lately just being used for patch notes, there used to be a wider range of technical articles. Once everything has settled into place (closer to 1.0), this tutorial series can become integrated with the modding documentation where it's updated as necessary. I also feel having these posts in web format will make it easier to share and translate compared to the PDF/Word format I started with.

I will also extend tutorial examples beyond just French, German, English translations and include an East Asian language (Korean based on that community reaching out above) and a Slavonic language (Czech as we seem to have quite a few native speakers here). Just to clarify, tutorials and screenshots will be in English as that's the only language I know. But the process will include steps to localize French/German/English/Korean/Czech, along with setting locale-aware fonts for Korean and Czech.

I'm also working on a few fixes for text assets. The most problematic is ID 9000, the huge question and answer block for class questionnaire. This text is so long it doesn't work fully in Unity string editor. I'm going to break this down into individual records for each question - e.g. 9000.1, 9000.2, etc. This makes it much easier to maintain and edit. Importing from classic and translated TEXT.RSC files still works as before.

Once that's out of the way, I need to start tackling some of the remaining in-game text sources not currently covered by localisation, e.g. support for FACTION.TXT and translated quest text overrides. This will be ongoing for a while as Daggerfall's base design spreads text all around the place. Organising this back to a single concerted set of text databases is a huge and difficult work.

koreanfonter
Posts: 4
Joined: Sat Jan 16, 2021 5:35 am

Re: Daggerfall Unity 0.10.26 Localization Preview

Post by koreanfonter »

I've been waiting for your news. Thank you very much! I translated your words to people who are interested in daggerfall in Korea. We can wait for you to finish, so please do not overdo it. However, the part I would like to ask is that there are many people in Korea who have difficulty with unity3d. I would like you to link the text data of daggerfall to a loose file.

Post Reply