Localization Issue

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
laurelhach
Posts: 18
Joined: Fri Jan 01, 2021 2:59 pm

Localization Issue

Post by laurelhach »

Hi Tony,

I don't really know exactly how works all the localization stuff, but as I am digging into it (as I previously said, I'm using I2) I see that you are looking at string tables but not always your default database localization.

Here is another example where I don't get my NPC name translated:
In the code below it looks like you are searching in your tables, but the name of the NPC giving the quest has all the localization done in the dialogue database only (switching I2 <=> dialogue database).
(Clivking on the Actor tab I can see all the translation in the All Fields section of the Database.

Is it possible that it's another bug?
This is the code from the Usable script.

Code: Select all

        public string GetName()
        {
            if (string.IsNullOrEmpty(overrideName))
            {
                return DialogueActor.GetActorName(transform);
            }
            else if (overrideName.Contains("[lua") || overrideName.Contains("[var"))
            {
                return DialogueManager.GetLocalizedText(FormattedText.Parse(overrideName, DialogueManager.masterDatabase.emphasisSettings).text);
            }
            else
            {
                return DialogueManager.GetLocalizedText(overrideName);
            }
        }
Thanks in advance!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Localization Issue

Post by Tony Li »

Hi,

If you leave the Usable's Overrode Name field blank, add a Dialogue Actor component to your NPC's GameObject, and set the Actor dropdown, it should use the localized version in the dialogue database.

However, if you have assigned text to the NPC's Usable component's Override Name field, it will use the Override Name value and check if there is a localized version in the Dialogue Manager's Text Table asset.
Post Reply