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”
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?
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.
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:
now I add a new language, Bulgarian, create a table, and its not marked as smart anywhere:
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:
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.
What is the benefit of requiring manually marking “smart” in the first place? Is there a downside to just defaulting every string to “smart”, and/or auto-detecting if it’s smart by the existence of bracket notation?
If every string was marked smart then we would need to parse and format them every time which would be slower and possibly generate some garbage. Auto detecting them as smart should be fine as long as your text wont contain any text that is encapsulated in { } brackets.