Is it possible to add 'Localize String Event' component in script?

The only answer I found to my question is here - Attempting to set the Update String of the Localize String Event using a script

But it use functionality of UnityEditor package, so Im not able to build my app, because this package is not allowed in build.

P.S. sorry for stupid question, figure out solution shortly after asking - its not necessary to add it via script in my case.
I added this event components to texts in Editor to my prefab, set the ‘Update string’ to point to ‘TextMeshProUGUI.text’ and left ‘String reference’ and ‘Table collection’ empty to configure them in script and it was enough to my goal.

You can right-click on the TMPro component header line and select Localize and it will add the LocalizeStringEvent AND it will connect all that above stuff and fill out defaults:

It also works for Localizing assets (images, etc.):

1 Like

It will save me a lot of time, thanks!

1 Like