The textunit resIds for JSON are generated with contentHash, which means the TextFlowTargets for:
will be the same.
This may not be desirable, as there is no context or convention that says they are they same in the way of translatable text.
There should be a means of getting the global id, e.g. thing.title, and using that in the resID.
See test JSONAdapterTest:testDuplicateContent.
For arrays, we should probably use indices, eg
.
If we make the resIds based on a unique path, we should probably avoid using a content hash entirely. This would allow us to track the identity of a string over time, even with changes in the English text, as we do for properties files (where the property key is the resId). This would allow for smarter translation memory logic.
It appears that, by using the parameter
I can get a decent path that for
I get
This makes it easy to handle things well enough, though I either need to have some magic with standalone strings (First, Second) or take them out of consideration.