Fixed First translation of a phrase

Old Nick

Well-known member
Affected version
2.3 RC 2
Step to reproduce:
  • You translate a phrase for the very first time then you save it
  • You immediately click on the Edit button
Result: The editable field displays the original phrase.
This phenomenon does not occur if the phrase has been edited before (frame with a red border)
 
The specific steps here do not line up with how things actually work, but I think I roughly understand what might be going on.

If at any point you use the back button in your browser to go back to the index, you will be getting a cached copy of the page. The cached copy of the page will contain a link to modify the phrase in the parent language, rather than the new phrase you just created.

It's a little confusing but for various technical reasons that behaviour is correct.

To avoid this, you'll most likely be wanting to use "Save and Exit" rather than navigating with the back button.
 
I don't use my browser's back button at all and there is no "Save and Exit" in this case.
I think I expressed myself poorly, and perhaps pictures will illustrate my point better.

Step 1
step1.webp

Step 2 : i translate the phrase
step2.webp

Step 3 : I save it
step3.webp

Step 4 : i click the Edit button
step4.webp

My translation is not saved.
 
My translation is not saved.
It is saved, but the form action URL is not updated so when you click Edit again it edits the original phrase, not the translated one.
You can confirm his by reloading the page after initial save.

This kinda annoying issue (which is a regression from 2.2 as it works fine there) seems to be caused by
Code:
XF.Animate.fadeUp(this.target, {
    complete: () =>
    {
        this.target.innerHTML = ''
        this.target.append(...html.childNodes)
        onComplete(false, html)
        XF.Animate.fadeDown(this.target)
    },
})
which replaces the inner HTML but does not update the form action target so the phrase ID is still the same afterwards.

Changing this to smth. like
Code:
XF.Animate.fadeUp(this.target, {
    complete: () =>
    {
        this.target.replaceWith(html)
        onComplete(false, html)
        XF.Animate.fadeDown(html)
    },
})
seems to fix this.
 
Last edited:
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.4).

Change log:
Fix an issue with editing newly translated phrases
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom