Page MenuHomePhabricator

Indicate in output whether an interwiki link is marked local
Open, LowestPublicFeature

Description

Author: happy.melon.wiki

Description:
We have a number of different types of links that the parser can generate, which are rendered with different classes:

*[[foo|internal link]] --> <a>
*[[meta:Foo|interwiki link]] --> <a class="extiw">
*[[:Fr:Foo|inline interlanguage]] --> <a class="extiw">
*[[google:Foo|external interwiki]] --> <a class="extiw">
*[http://www.google.com external] --> <a class="external text">

There is no distinction between 'local' interwikis or interlanguage links, and 'nonlocal' interwikis. It would be nice if this were the case. That is, it would be nice if, eg:

*[[foo|internal link]] --> <a class="internal">
*[[meta:Foo|interwiki link]] --> <a class="internal extiw">
*[[:Fr:Foo|inline interlanguage]] --> <a class="internal extiw">
*[[google:Foo|external interwiki]] --> <a class="external extiw">
*[http://www.google.com external] --> <a class="external text">

Repurposing the then-somewhat-obscurely-named "extiw" class to indicate the interwiki origin of the link, rather than its nature as a 'local' or 'nonlocal' link.

This could be tricky because, as far as I can tell (and as the quip from Tim at the top of the screen occasionaly indicates) the evil mess of code in Parser::replaceInternalLinks() doesn't really do anything, it's just cover for the imps that actually do the link processing :D


Version: 1.15.x
Severity: enhancement

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:36 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz18562.
bzimport added a subscriber: Unknown Object (MLST).

There's no need for an "internal" class; it was discarded years ago as a waste of space. Internalness is the default state of a link that's not specified as something else.

If there is any need to mark "internal interwikis" distinctly, this would likely be with an additional class; there would be no particular relation between interwikis and in-wiki links.

happy.melon.wiki wrote:

I'd think that marking *external* interwikis would be the more logical approach. I see what you mean about "internal" being redundant. So I guess this is all we need:

*[[foo|internal link]] --> <a>
*[[meta:Foo|interwiki link]] --> <a class="extiw">
*[[:Fr:Foo|inline interlanguage]] --> <a class="extiw">
*[[google:Foo|external interwiki]] --> <a class="external extiw">
*[http://www.google.com external] --> <a class="external text">

Just to summarize, you want:

  • [[google:Foo|external interwiki]] --> <a class="extiw">

to become:

  • [[google:Foo|external interwiki]] --> <a class="external extiw">

Everything else appears to stay the same.

happy.melon.wiki wrote:

Yes, and ditto for all interwiki links marked with iw_local=0. Combined with bug11477 this would go a long way towards restoring the semantic meaning of the external link icon.

Change 146711 had a related patch set uploaded by TTO:
Add "external" class to non-local interwiki links

https://gerrit.wikimedia.org/r/146711

(In reply to Happy-melon from comment #4)

Combined
with bug11477 this would go a long way towards restoring the semantic
meaning of the external link icon.

I disagree that this is a solution for that. If you feel an interwiki link should be an external link, ask for the interwiki prefix to be removed from the interwiki map. I suggest WONTFIX here.

I disagree that this is a solution for that. If you feel an interwiki link should be an external link, ask for the interwiki prefix to be removed from the interwiki map.

I still think so (for the case [[google:]] etc. in Wikimedia, and for any interwiki that a non-Wikimedia wiki doesn't like; many wikis just remove them all).

However, as noted in T191405#4104637, adding the "external" class, while not changing the rest of the output, is a valid solution for the Wikimedia-specific feature request to be able to differentiate non-local interwikis visually.

Change 146711 had a related patch set uploaded (by TTO; owner: TTO):
[mediawiki/core@master] Add "external" class to non-local interwiki links

https://gerrit.wikimedia.org/r/146711

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