Page MenuHomePhabricator

Automatic cite feature in VisualEditor on English Wikipedia sets edition as "X edition ed."
Open, MediumPublic0 Estimated Story Points


If you plug a URL into the Cite feature in VisualEditor on English Wikipedia that is for a 2nd or 3rd edition book, it creates a weird entry for the edition data.

For example:
Programming: Principles and Practice Using C++ (2 edition ed.). Upper Saddle River, NJ: Addison-Wesley Professional. 2014-05-25. ISBN 9780321992789.

This is because the Citoid API returns "2nd edition" as the edition, but the Cite Book template on English Wikipedia expects just "2nd".

  • Strip "edition" from mediawiki format in backend and leave as numeral (i.e. '2')
  • Add ordinal indicators in en wiki, if value is numeral (i.e. convert '2' to '2nd')
  • Bonus points, fix other language templates :)

Event Timeline

kaldari created this task.Dec 12 2015, 12:33 AM
kaldari raised the priority of this task from to Needs Triage.
kaldari updated the task description. (Show Details)
kaldari added projects: VisualEditor, Citoid.
kaldari added a subscriber: kaldari.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 12 2015, 12:33 AM
Jdforrester-WMF changed the task status from Open to Stalled.Dec 15 2015, 8:20 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

I think the template should probably be fixed, given we can't programmatically find string matches and remove them without user input in general.

Mvolz moved this task from Backlog to Site specific issues on the Citoid board.Jan 12 2016, 10:14 AM
Izno added a subscriber: Izno.EditedFeb 19 2016, 4:42 PM

I think the template should probably be fixed, given we can't programmatically find string matches and remove them without user input in general.

What "fix" do you envision for the template? The template is currently functioning as expected and in fact would have the same "issue" as is being requested to be changed in this task, so clearly when you mean "fix" you mean some other change in functionality.

Mvolz added a subscriber: Mvolz.Oct 28 2016, 2:39 PM

There are two options:

  1. Validate the edition field in the backend, and remove the word "edition" on the backend
  2. Fix the template to validate the edition field, and remove the word "edition" in the template and only display the "2" part.

I don't really like the behaviour of the either the template or the backend here.

For instance, it seems to me that the parameter in the form looks like "Edition: 2", then the optimal way to display this would be "2nd edition" and use the ordinal indicators here. 2 ed. doesn't look right.

But, "2 edition" is not great either, because of the same issue.

I'd be happy to clean this up in the backend, but I'm mostly worried about cases of how to handle it where the edition is not a numeral, i.e. some kind of special edition. Like 10th anniversary edition or something. Example:

This one is weird: special ed edition.

The other issue is overfitting to mediawiki format; another consumer might want the "edition" bit in there. Although I guess it is challenging for i18n, and no other consumers are really using it, so that concern is probably pretty minimal.

Mvolz added a comment.Oct 28 2016, 2:49 PM

i18n assessment:

fr: doesn't use edition field.
de: same as en, i.e. "2 edition ed."
it: displays field with no additions, i.e. "2 edition"
fi: doesn't use edition field
es: uses english?? "2 edition edition"

Mvolz updated the task description. (Show Details)Oct 28 2016, 2:58 PM
Mvolz added a comment.Oct 28 2016, 3:00 PM

For i18n issues, it would be best to validate this down to numerals. But not much we can do about "special edition" or "10th anniversary edition"- we can't translate that, is it better to leave the edition part off for these as well?

Mvolz changed the task status from Stalled to Open.Oct 28 2016, 3:01 PM
Mvolz triaged this task as Medium priority.
Mvolz moved this task from Site specific issues to Service on the Citoid board.Oct 28 2016, 3:03 PM
Jdforrester-WMF set the point value for this task to 0.Feb 9 2017, 6:16 PM
Utar added a subscriber: Utar.Sep 13 2017, 9:20 AM

At cswiki we use edition field too and add to it "vyd." (vydání) as Czech translation of "ed." (edition).
For automatic cite feature via ISBN in VisualEditor it leads to things like "1. české vyd. vyd." (1st Czech ed. ed.).
More at Czech Village Pump.

Not only "vyd." (="ed." or "edition" in English) is doubled at, but also the abbreviation "s." meaning "page". For example "p. 47" is written as "47 s. s." instead of correct "47 s."