Page MenuHomePhabricator

Section editing: Off-by-one error and "empty translation unit"
Open, LowPublicFeature

Description

Author: davidrichfield

Description:
While trying to edit the section "Attendees" on https://meta.wikimedia.org/wiki/Wikimedia_Diversity_Conference/Participants I ended up on the section "How you can get involved". When I edited the URL to read "section=1", I got to the right section, but when I tried to save, the page wasn't saved, I stayed in the edit dialog, and I got the error message 'Empty translation unit for marker "68".' That's why I think it's got to do with the translate extension.


Version: unspecified
Severity: enhancement

Details

Reference
bz56838

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:24 AM
bzimport set Reference to bz56838.
bzimport added a subscriber: Unknown Object (MLST).

Translate extension does not currently support section editing.

In addition the page is not following the best practices in handling markup: https://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_administration

There is no hope for a fix before bug 48891 gets any traction.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM
Aklapper removed a subscriber: wikibugs-l-list.

I would close this task as Invalid, since that seems impossible to reproduce with a bit cleaner markup:

  • with recommended syntax, the unit marker is after the heading syntax, so in the following section.
  • with discouraged (but pretty common) syntax with translate tag inside heading syntax, the unit marker goes inside the heading, so in the following section too.

I don’t see any credible use case where we might want this unbalanced markup, with only the opening heading syntax in the unit.

While https://meta.wikimedia.org/wiki/Wikimedia_Diversity_Conference_2013/Participants is indeed a nightmare, pages are rarely that broken, there’s a not recommended, yet often-used syntax that also demonstrates this issue: when headings and opening paragraphs form one translation unit. For example:

<translate>
== Heading ==
Lorem ipsum dolor sit amet.
</translate>

gets transformed to

<translate>
<!--T:1-->
== Heading ==
Lorem ipsum dolor sit amet.
</translate>

instead of

<translate>
== Heading == <!--T:1-->
Lorem ipsum dolor sit amet.
</translate>

Recently, Translate even started moving IDs away from the heading line if the translation unit doesn’t consist solely of a heading.

<translate>
== Heading ==
Lorem ipsum dolor sit amet.
</translate>

gets transformed to

<translate>
<!--T:1-->
== Heading ==
Lorem ipsum dolor sit amet.
</translate>

instead of

<translate>
== Heading == <!--T:1-->
Lorem ipsum dolor sit amet.
</translate>

I believed that was the opposite, my bad. So I agree we should keep this request open, because this syntax is common and does not break untranslated wrapping.

Sorry, not sure I understand. If the syntax is common /but/ wrong or otherwise not recommended or inefficient, shouldn't that syntax just be changed in the first place?

It’s not recommended, i.e. SHOULD NOT be used in the RFC 2119 sense; it’s not a MUST requirement. Changing the syntax means that an existing translation unit needs to be split into two; migrating existing translations requires a considerable amount of manual work, and loses some metadata like the page history of the translation unit and eventual outdated (“fuzzy”) state of the translation.