LocalizedString as argument of LocalizedString.Arguments for recursive localization?

I though I read somwhere that I can add LocalizedStrings to the LocalizedString.Arguments list, but that doesn’t seem to be possible. It would be nice to have since I have recursive smart strings that require localized strings as inputs.

For example:
“Move {}” with {} being an object’s name that is retrieved through a LocalizedString.
Right now I’m passing in the name LocalizedString.GetLocalizedString() value, but of course this doesn’t update on language change. Of course I could register my own callbacks, but I feel like it could be nice for this to be an included feature?

LocalizedString needs to be part of the local variables, it won’t work in the Arguments.
https://docs.unity3d.com/Packages/com.unity.localization@1.3/manual/Smart/Persistent-Variables-Source.html

There’s also a sample in the package manager for showing different gender that uses nested localized strings.

1 Like

Gosh, I completely missed that. I’m a bit confused now… why would you not use local variables for anything then? Why is Arguments still a thing?

It’s for backward compatibility with String.Format which is why it’s more limited.

1 Like