The tock_i18n_reset_value_on_default_change property should overwrite messages in TOCK Studio only when the default localizations change in the code. Instead, it always overwrites, which makes it impossible to update messages from the backoffice.
Causes
I have identified 2 causes for this issue:
The message mismatch detection currently checks for the defaultLabel field, but this field always gets updated when the label for the default locale changes.
The I18nLabel#defaultI18n field is deleted every time a message is changed in the backoffice
Proposed solutions
For the first issue, the easiest solution seems to be to ignore defaultLabel changes for the purpose of checking for programmatic updates. This means that the defaultI18n field will be the only field that matters for this check.
For the latter issue, based on my understanding of TOCK Studio, two possibilities are available. The first one is to send the defaultI18n collection to the browser, alongside all the other fields, so that the frontend can send it back when saving. This may be easier and more consistent with what is done currently, but it also means potentially transferring a lot of data that is not used in any way by the frontend. As the "answers" tab is already taking a long time to load on larger bots, I believe this to be an issue of its own.
The other solution is to make it so the "save" operation in TOCK Studio only updates the label instead of replacing it, such that the defaultI18n field is preserved.
The
tock_i18n_reset_value_on_default_change
property should overwrite messages in TOCK Studio only when the default localizations change in the code. Instead, it always overwrites, which makes it impossible to update messages from the backoffice.Causes
I have identified 2 causes for this issue:
defaultLabel
field, but this field always gets updated when the label for the default locale changes.I18nLabel#defaultI18n
field is deleted every time a message is changed in the backofficeProposed solutions
For the first issue, the easiest solution seems to be to ignore
defaultLabel
changes for the purpose of checking for programmatic updates. This means that thedefaultI18n
field will be the only field that matters for this check.For the latter issue, based on my understanding of TOCK Studio, two possibilities are available. The first one is to send the
defaultI18n
collection to the browser, alongside all the other fields, so that the frontend can send it back when saving. This may be easier and more consistent with what is done currently, but it also means potentially transferring a lot of data that is not used in any way by the frontend. As the "answers" tab is already taking a long time to load on larger bots, I believe this to be an issue of its own.The other solution is to make it so the "save" operation in TOCK Studio only updates the label instead of replacing it, such that the
defaultI18n
field is preserved.