Page MenuHomePhabricator

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

Description

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:
http://www.amazon.com/Programming-Principles-Practice-Using-2nd/dp/0321992784/ref=sr_1_1?s=books&ie=UTF8&qid=1449880161&sr=1-1&keywords=Programming+2nd+edition
Creates:
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 raised the priority of this task from to Needs Triage.
kaldari updated the task description. (Show Details)
kaldari added projects: VisualEditor, Citoid.
kaldari subscribed.
Jdforrester-WMF changed the task status from Open to Stalled.Dec 15 2015, 8:20 PM
Jdforrester-WMF subscribed.

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

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.

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: https://citoid.wikimedia.org/api?format=mediawiki&search=https%3A%2F%2Fwww.amazon.com%2FVampire-Academy-10th-Anniversary-Richelle-ebook%2Fdp%2FB01LMU3KOE%2Fref%3Dsr_1_1%3Fs%3Dbooks%26ie%3DUTF8%26qid%3D1477665321%26sr%3D1-1

This one is weird: special ed edition. https://citoid.wikimedia.org/api?format=mediawiki&search=https%3A%2F%2Fwww.amazon.com%2FElder-Scrolls-Skyrim-Special-Official%2Fdp%2F074401784X%2Fref%3Dsr_1_1%3Fs%3Dbooks%26ie%3DUTF8%26qid%3D1477665417%26sr%3D1-1%26keywords%3Dspecial%2Bedition

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.

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"

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.

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 cs.wiki, but also the abbreviation "s." meaning "page". For example "p. 47" is written as "47 s. s." instead of correct "47 s."