Search Unity

Feedback LocalizedString as argument of LocalizedString.Arguments for recursive localization?

Discussion in 'Localization Tools' started by julcreutz, Aug 25, 2022.

  1. julcreutz

    julcreutz

    Joined:
    May 4, 2021
    Posts:
    21
    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?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    julcreutz likes this.
  3. julcreutz

    julcreutz

    Joined:
    May 4, 2021
    Posts:
    21
    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?
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    It's for backward compatibility with String.Format which is why it's more limited.
     
    julcreutz likes this.