[solved] String Tables clears after restarting Editor

Hello,

i have the probem that some of my keys completely resets. It only affects newer entrys.
I copied the procedere from the the “Loading Strings” examples for my Non-Monobehaviour classes and scriptable objects some weeks ago.
It worked really well, but as of today, every new entry randomly clears after multiple playmode sessions and every time after i restart the UnityEditor. Strangley the old entrys are not affected.

Im using Unity 2021.3.3f1 with Localization 1.0.5

Im not sure I understand what you mean. What is resetting? Have you tried updating to 1.3.1?

I mean the entry inside the string Table with the specific Key just clears. Like it got never created.
It happens only to new entrys which got created by a script, like in these pictures.
For Example: I start the Playmode, the different objects gets loaded ingame. When there is no key, this script creates one for me. I then Edit the specifc languagefields for the given key inside the string table and it works just fine. But when i close Unity and start Unity with UnityHub again, every entry which got created like that, is just gone. I need to create these keys and everything again but when i exit and start unity again, these are then gone too.

Thanks to your post i updated to 1.3.1 but sadly it didnt fix the issue.

But i made some progress. I created a new table and tried the same thing. It got populated with new keys when needed and i translated like always. When i restarted Unity, the table was empty again, like i never did anything. But if i open this empty string table then, create a new key by hand and after that create the next key with my script, it gets saved and persists even after i restart unity.
It is really strange. Older tables which are still populated with old keys and entrys still clears newer entrys when i restart unity. But if i create in these one new key again by hand and then create new keys by script, these new keys persist then too.

So maybe the cause for this issue is, that i reinstalled the localization package some weeks ago (uninstalled and after that installed it again). Every key i created before that will persist without porblems. Every new key will get destroyed until i create atleast one new key by hand in this specific table (so i must do this in every table to save the new by script created keys).!?

8154833--1059590--1.PNG
8154833--1059593--2.PNG

Ah I see. You need to mark the table as dirty or changes won’t be saved and the asset will lose it like you are seeing.
Call EditorUtility.SetDirty on the table you modify and the tables Shared data.

Thank you. That fixed my issue.

1 Like