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 How to mark localized entry as smart? As now, its unusable

Discussion in 'Localization Tools' started by Wrymnn, Jul 18, 2023.

  1. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    352
    When I want to make a localized key as smart, since I want to use variables, currently it seems the only way is to mark all the languages manually as "Smart"

    upload_2023-7-18_10-56-31.png

    as you can see, this creates HUGE problem, as now I need to tick all the "Smart" boxes for each and every language. And now if I want to have dozens of keys marked as smart, across 15 languages, now I need to do 100+ of manual clicks just do to it.

    Whats worse, in the future, if we decide to add another new language, that langauge won't be marked as "Smart" in none of the localized strings! So now we have to go over all the keys in our database (1000+) and mark it as smart.

    This is completly unusable system as of now, since as far as I know, there is now way to mark entire localized string as "Smart".

    Does anybody know how to solve this issue? Or can Unity please implement a checkbox for the entire LocalizedString, so all the languages are automatically marked and used as smart?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,820
    If you mark them all smart and then add another table the new entries should automatically be marked as smart. We have UX improvements coming in 1.5 that will let you mark all entries as smart. For now you can do it with a script.
    Here is a script that will add a context menu to mark the localized string entry as smart. You may need to refresh the inspector after to get it to update.

    https://gist.github.com/karljj1/fda3c7f128a72fb3aeea2984b0619188
     
  3. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    352
    Thank you @karl_jones, but where to trigger this event?
    I use LocalizedString in a ScriptableObject, so I don't see this context menu anywhere, can you point me where can I trigger this

    I am not talking about another table, but another language. So I marked all 15 languages as smart, then I added for example Bulgarian, taken a look at my LocalizedString, and Bulgarian was not marked as smart, so in this case, the text would not work correctly for Bulgarian and we would not even know about this. We would have to go over all the translation keys in our database and mark each smart keys for Bulgarian manually.

    So as an example, here are all the langauges marked as smart for a specific LocalizedString:

    upload_2023-7-18_12-13-28.png

    now I add a new language, Bulgarian, create a table, and its not marked as smart anywhere:
    upload_2023-7-18_12-13-55.png
    and we have dozens of LocalizeStrings in our project that need to be marked as smart.

    For context, I am talking about LocalizedString in our ScriptableObjects:

    upload_2023-7-18_12-15-55.png

    upload_2023-7-18_12-15-40.png
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,820
    You would need to change the script to be a context menu for your scriptable object Use case. Use the ContextMenu attribute and copy the example I posted.
    We don't currently have a global is smart setting per entry but it is planned. For now you can create some editor scripts, such as the example I provided.
     
    Wrymnn likes this.
  5. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    352
    Thank you, will try that :)
     
    karl_jones likes this.