Closed eamon0989 closed 2 years ago
The context is not part of the translation. It is part of the connection between user and translation. Do you need the original context back?
If possible that would be great. Then it greatly simplifies frontend logic as I can just swap to updated translation object with the old one.
OK, you want a UserTranslation
object back. Got it. Slightly more complicated.
What are you sending to the server for a translation update? A UserTranslation
, ie. translation + potentially changed context? Or just a Translation
? Does the context always remain the same, ie. from the first encounter?
The context always stays the same, it's set when a user first adds a translation and is always linked to that object, event if the user changes the translation.
Here's an example of what is being sent:
{
context: "SONDAGE - Selon un sondage Odoxa-Backbone Consulting pour Le Figaro, les Français
seraient 59% à être d'accord avec Emmanuel Macron, mais le jugent «brutal» (59%) et moins
«proche des gens» (74%)."
id: 35
targetLanguageId: "en"
translation: "judge"
wordId: 19
}
The properties of updated translations are being sent in snake_case, they need to be converted to camelCase before being sent to the frontend.
The context is not being sent back from the server when a translation is updated.