Page MenuHomePhabricator

when forgetting a newline after translate marker VE doesn't display the real error message
Closed, ResolvedPublic

Description

VE error: The modification you tried to make was aborted by an extension hook
Source editor error:

Translation unit markers in unexpected position. 
Translation unit text:

<!--T:83-->In general it is preferred to share code via composer components instead of extensions. If the classes of an extension only need to exist, but the extension does not need to be configured nor loaded, for what you want to do, that is a strong indicator that that code should be split off into a composer component you should depend on instead.

Found during https://www.mediawiki.org/w/index.php?title=Manual%3AExtension_registration&type=revision&diff=1974486&oldid=1974468 .

Event Timeline

JanZerebecki raised the priority of this task from to Needs Triage.
JanZerebecki updated the task description. (Show Details)
JanZerebecki subscribed.
Jdforrester-WMF set Security to None.
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.

If you request a change in Translate, please state what that is explicitly.

I only described the problem a user experiences. The next step is finding a solution, do you have a suggestion how either VE or Translate could be modified to solve this?

Well, editing translatable pages with VE is not currently a supported use case, so I am not sure whether anything needs to be done until it is. I could make Translate extension more lenient on the placing of the tags with slightly increased risk that some bad changes get through.

Well, editing translatable pages with VE is not currently a supported use case, so I am not sure whether anything needs to be done until it is.

It would be helpful if the error from Translate could actually be read by the user, instead of hiding it behind a generic message. (As it is when making the same edit with the source editor.)

I could make Translate extension more lenient on the placing of the tags with slightly increased risk that some bad changes get through.

I don't think that fixes the issue, as that would still leave other Translate syntax errors, that need to be displayed to the user.

OK. Please let me know if changes in Translate are needed to display the errors correctly in VE. As far as I know I am using the hooks correctly to report the errors.

Tacsipacsi subscribed.

It has been fixed some time in the past five years, now a proper error message is shown:

Screenshot_2021-07-31 Manual Extension registration - MediaWiki.png (451×498 px, 37 KB)