Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Localize Smart Variable?

Discussion in 'Localization Tools' started by Fufeer, Sep 27, 2023.

  1. Fufeer

    Fufeer

    Joined:
    Jan 2, 2020
    Posts:
    7
    Hi!

    I have come up with a question/problem while localizing my game, and I have not been able to find a way around it in the documentation, or through Googling. It is very possible that I am not approaching my problem correctly, so please point me in the right direction if needed!

    I am trying to localize the following string: "You need to play a tutorial before you can use {moduleEntry}! Play tutorial?"

    I have different modules in my game, each with its own entry in the LocalizationTable. What I would like to achieve, is for the Smart Variable {moduleName} to find its translation using the "moduleName value" as an entry in the table. Is this possible, and if so, how should I do this? Can I do something like {tableName.moduleName}?

    Thank you in advance!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Hi,
    Yes, you can do this with nested localization.
    https://docs.unity3d.com/Packages/c...ent-Variables-Source.html#nested-translations

    Note, that there's a potential for increased complexity that could make translations more challenging. Sentence structure alterations might be necessary for specific items, as illustrated in the gender example on the same page. Although this might result in a larger amount of text, presenting the entire sentence for each item can sometimes simplify the translation process.
     
  3. Fufeer

    Fufeer

    Joined:
    Jan 2, 2020
    Posts:
    7
    Wow, that was incredibly fast. I am giving it a shot, thank you very much!
     
    karl_jones likes this.