Hi, I’m importing a CSV dynamically via script into the string table collection, but some of these entries need to be smart, is there a way to set them as Smart via script?
Hi,
Yes, you can get the entry and set its IsSmart flag. Like so:
var collection = LocalizationEditorSettings.GetStringTableCollection("My Strings");
var table = collection.GetTable("en") as StringTable;
table.GetEntry("My Entry").IsSmart = true;
however, for your use case, I would suggest creating a custom column in the CSV that can be used to indicate if an entry is Smart. Take a look at the CSV samples included with the package. Samples can be found via the package manager window.
You want CsvCustomColumnsExample
Sorry, I don’t understand how it works…
If I try to create a script with the code in the CsvCustomColumnsExample to see what it does, I get an error on using CsvHelper because it can’t find it and I suppose the other error CsvReader is related
I’m really not that good at coding so I might not understand some of these things
Csvhelper is included in a dll that needs to be added to the asmdef. Take a look at the one that comes with the sample. You will need your code to be in an asmdef file.
