Hello!
Im using the usable system of this asset as main interactuable for my project. I need to translate the names of the interactuable items (like doors, chests, and generally non actor names).
I know I can use a text table and use the key in the override field of the usable. But I was wondering if there's a way to make it work with the unity localization tables. Maybe making an item in the dialogue database (this way the name of the item appears in the unity localization tables).
If there´s currently a way to do it i'm not aware of it.
thanks in advance!
Localize usable overrides with Unity's localization
Re: Localize usable overrides with Unity's localization
Hi,
Internally, the Usable component calls DialogueManager.GetLocalizedText() to look for a translation in the Text Table asset.
In the next release, I'll plan to update the Localization Package integration so it replaces DialogueManager.GetLocalizedText() with its own version that looks for a translation in the Localization Package's string tables.
In the meantime, or alternatively, you can make a subclass of Usable and override the GetName() method to pull translations from Unity's Localization Package.
Internally, the Usable component calls DialogueManager.GetLocalizedText() to look for a translation in the Text Table asset.
In the next release, I'll plan to update the Localization Package integration so it replaces DialogueManager.GetLocalizedText() with its own version that looks for a translation in the Localization Package's string tables.
In the meantime, or alternatively, you can make a subclass of Usable and override the GetName() method to pull translations from Unity's Localization Package.
Re: Localize usable overrides with Unity's localization
Thanks for the quick response!
I that solution doesnt seem complicated, i will try.
The updates soud great, keep the good work.
I that solution doesnt seem complicated, i will try.
The updates soud great, keep the good work.
Re: Localize usable overrides with Unity's localization
I found another solution, if anyone is interested:
I made the Usable Override name in the Usables as an autoproperty
this way I can attach a LocalizeStrignEvent that recognizes the override name as a dynamic string.
Same thing can be done with OverrideUseMessage.
The downside is that the inspector gets poluted with extra components. For each full translated usable = TWO LocalizeStringEvents.
Also, if the language is changed when the usable UI is active, it won't update the text untill you exit and re enter the trigger area.
I made the Usable Override name in the Usables as an autoproperty
Code: Select all
[field: SerializeField] public string overrideName { get; set; }
Same thing can be done with OverrideUseMessage.
The downside is that the inspector gets poluted with extra components. For each full translated usable = TWO LocalizeStringEvents.
Also, if the language is changed when the usable UI is active, it won't update the text untill you exit and re enter the trigger area.