Page 1 of 1

Localization Issue

Posted: Tue Jan 05, 2021 12:49 pm
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!

Re: Localization Issue

Posted: Tue Jan 05, 2021 1:33 pm
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.