Skip to content

Always include source attributes & declarations in Editor base value - #4427

Merged
mathjazz merged 2 commits into
mozilla:mainfrom
eemeli:webext-decl
Sep 1, 2026
Merged

mathjazz merged 2 commits into
mozilla:mainfrom
eemeli:webext-decl

Conversation

@eemeli

@eemeli eemeli commented Aug 19, 2026

Copy link
Copy Markdown
Member

Fixes #4414

Based on #4262 (comment), I presume that @havarh has submitted the translations we currently have for nb-NO and nn-NO by manually crafting POST /translations/create/ requests. These end up rendering as apparently-correct in Pontoon, but don't include the placeholder declaration object that's required (a bit of a web extensions specialty).

The original issue leading to that workaround has since been resolved by #4313. However, now that we do have these not-quite-right approved translations, editing them turns out to not work well, as we've been presuming that approved translations are a valid starting point for further translations, and this is not the case here. Attempting to edit those translations will now fail due to a parsing error.

This PR fixes the front-end's capability to edit partial translations like this, making it more robust in general -- though this particular error case should only have been possible to reach with webext translations, and by manually crafting the POST request.

After this is merged and deployed, it should be possible to edit the invalid translations by e.g. adding and removing a space character to trigger the translation re-parsing, which should enable the Save/Suggest button to submit a valid translation for what appears to be the same translation. Explicitly rejecting the current translations and re-entering them should also work already now, though I've not verified that.

@eemeli
eemeli requested a review from mathjazz August 19, 2026 16:31

@mathjazz mathjazz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving.

Verified the new test fails on main.

@mathjazz
mathjazz merged commit 3438c4e into mozilla:main Sep 1, 2026
10 checks passed
@eemeli
eemeli deleted the webext-decl branch September 1, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Variable in JSON Webextension format serialized incorrectly

2 participants