Pretty much what the title says. Is there a way to sort entries in code? I’d like to order them alphabetically by their keys. Ordering them using the UI won’t work as there’s 1000+ keys. It’s important they appear in the right order as game has a lot of story and without context about the previous key it will be hard to translate.
Keys are sorted by the tables SharedTableData. Sort the Entries list. Make sure to set the shared table data dirty to save the changes.
Thanks for the fast reply! Works as intended.
If storyTable is your StringTable that’s the code you need.
storyTable.SharedData.Entries.Sort((a,b)=>a.Key.CompareTo(b.Key));
EditorUtility.SetDirty(storyTable.SharedData);
Maybe it will help someone.
3 Likes