We use Google Sheet as a source.
If two people ‘pull’ the data from google sheet, the table will generate different table’s key id for the new data which will create merge conflict. If we select PersonB key id to resolve the conflict, PersonA will get this error above in the string reference because they use the ‘same key but different key id’ when they serialized this asset.
Is there a way to circumvent this?
Yes. When we pull a new entry we assign a new Key, by default the new key is generated using the current time and a machine id value: Table Keys Generation | Localization | 1.3.2
You have 2 ways to solve your problem here.
-
Assign a different id generator. We also provide a Sequential Id Generator which will provide deterministic keys.
-
Add a manual Id for the new entries in the Google sheet. I would recommend this approach over 1.
In the Key column, you can see that each entry that exists has a note field with the Id stored inside. You can change this value or add one when its a new key.
On your new Key, right click and choose Insert Note.
Now type a number in to use as a key. In order to avoid conflicts, you should use a negative id value. We reserve the signed bit so that it can be used to add custom ids.
See Signed Bit:
https://docs.unity3d.com/Packages/com.unity.localization@1.3/manual/TableEntryKeys.html#distributed-id-generator
So you should be safe to start with -1 and just keep decrementing it each time, -2, -3, -4 etc.
Ill make sure we add something to the docs to help explain this further in the future.
Thank you for such fast reply <3
Sorry to bother you again Karl. If the key id got corrupted in multiple places, is there a way I can use custom script to fix the missing references?
You can go through and change the table entry reference with a script.
See change using I’d in this example
https://docs.unity3d.com/Packages/com.unity.localization@1.3/api/UnityEngine.Localization.Components.LocalizeStringEvent.html