Search Unity

Question Is there any way to format the localized text as unity does?

Discussion in 'Localization Tools' started by laloTT, Mar 2, 2023.

  1. laloTT

    laloTT

    Joined:
    May 25, 2018
    Posts:
    4
    Hello everyone!
    I'm working on a card based game and I have a card tool created on .Net that modify the tables and add new entries when I modify the cards, works great but then when I add or modify an entry in unity with the Localization tables editor and then I Save Project unity change the format of the text that I added by the card tool, for example:

    This is a text added by the card tool:
    '<scale=.56>Reduce lord''s cost for each friendly Recruit with 50[DMG] or more.</scale>'

    And this is the the text when I save project in unity:
    <scale=.56>Reduce lord's cost for each friendly Recruit with
    50[DMG] or more.</scale>


    Note that unity removes the simple quotes and add a jump line.


    Is there any way to format the localized text as unity does? or an algorithm? I know that unity save this as Yaml file, but use a Yaml api doesn't works because unity has his own rules about write yaml.

    Thanks!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    I'm not sure I understand. Your tool makes changes to the table but those changes are lost? Are you setting the table dirty? You need to call EditorUtility.SetDirty.on the table after you make changes.
     
  3. laloTT

    laloTT

    Joined:
    May 25, 2018
    Posts:
    4
    Thanks for the quick response!

    No the changes were not lost, I can write to the table with no problems and everything works as expected, but when I go back to unity after writing from the tool and save the project, unity applies formatting to my text, and I want to know if there is a way to replicate that formatting outside unity.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Hmm. This sounds like a bug, could you please file a bug report?