Page MenuHomePhabricator

Create a system to create language-agnostic wiki links
Open, Needs TriagePublic

Description

Summary
There isn't a way to share a link to an article that is language agnostic. I want to share a single link to a group greater than one person that will automagically direct to the article (if available) in the recipients preferred language.

Description
https://en.wikipedia.org/wiki/Goat will take a visitor to the English version of the Wikipedia article about Goats. If I send that link to another individual they have to be 1) fluent enough in English to understand the content and/or 2) Knowledgable enough to discover that there may be a version of the article in a different language (UniversalLanguageSelector in the sidebar as an example of how one might discover other language versions).

I would like to share a link to knowledge about Goats that does not predetermine the language. For argument:

wikipedia.org/wiki/Goat

But while that link is not the best option due to homonymies, we could use Wikidata: wikipedia.org/wiki/Q2934 that redirects to the matching article in the targeted language.

Note: The individual who submitted this task is not a programmer. I do not know if this is feasible. I also want a pony.

The rough logic would go, Is this user logged in to Wikipedia? If yes, what is their language preference?* Show the Goat article if available in that language, fallback languages if possible, and (ugh) English as a last resort.

Is the user logged out? Then take a guess via browser settings, location, or some other known identifier (or combination vis confidence scoring). Show the article in that language if available. Fallback to english as a last resort.

To keep this from causing false-positives/confusion, perhaps a subdomain could be used for purposefully sharing links of this nature. An idea from @Trizek-WMF would be something like share.wikipedia.org

Perhaps something similar to Special:MyLanguage for pages marked for translation?

Perhaps something similar to what the wikipedia.org portal does to determine language?

This task is to provoke discussion, so please poke more holes in my already leaky idea. :)

*Yes, I realize language preferences are per-wiki unless using global preferences (Thanks to @Johan for pointing this out).

Event Timeline

I think that this is the use case that interests me the most: At mediawiki.org, it should be possible to write, "TechCom has a weekly meeting in [[magic-language:IRC]]." and have everyone who clicks that link be able to figure out what IRC is.

It might make sense to specify an initial language (ie., en.share.wikipedia.org/wiki/Goat or en.wikipedia.org/wiki/Special:MyLanguage/Goat or whatever), otherwise the intent can be ambiguous. e.g., should share.wikipedia.org/Gift go to English "Gift" or German "Gift" ("poison")?

Perhaps something similar to what the wikipedia.org portal does to determine language?

That's the Accept-Language header, I believe. For users who are not logged in, that would be a great fallback for determining the user's language.

Speaking of fallbacks, specifying an initial language also makes it the fallback, and mitigates the problem of "(ugh) English as a last resort". If I send the link from German Wikipedia to someone who speaks Italian but no Italian version is available, then the original German link is a better last resort than an unexpected English link. (Also, there may not be an English version for, say, a minor German celebrity or historical figure or small German town, so falling back to English won't always work.)

So my suggested revision to the initial rough logic would be:

Use some URL element to indicate that this is a "share-in-your-language" link, coming from some specific source language (e.g., any of share.en.wikipedia.org, en.share.wikipedia.org, share.wikipedia.org/en, en.wikipedia.org/wiki/Special:MyLanguage, etc.).

Is this user logged in to Wikipedia? If yes, what is their language preference? Show the article if available in that language, use fallback languages if possible, and use the original language as a last resort.

Is the user logged out? Then take a guess via browser settings, location, or some other known identifier (or combination via confidence scoring). Show the article in that language if available, use fallback languages if possible, and use the original language as a last resort.

A random thought: it would probably be best to redirect to a specific article page, and not to a second share/MyLanguage link on the best-guess target wiki. Otherwise you could set up a redirect loop. For example, if on English Wikipedia I have my language pref set to Spanish, but on Spanish Wikipedia I'm not logged in and my browser language pref is English, then a share-in-your-language link on English would send me to Spanish, but a link on Spanish would send me back to English, rinse and repeat. It's a weird case, but I can see myself having such settings as a result of doing testing.

Would this default to the English meaning, then? https://en.wikipedia.org/wiki/Barn is about an agricultural building. https://sv.wikipedia.org/wiki/Barn is about children. If I write https://wikipedia.org/wiki/Barn, how is the software to determine which one to link to?

Wikidata items could solve it, but few know how to use them.

Wikidata items could solve it, but few know how to use them.

We need a "Share that page to anyone" link. :)

While Wikidata items would be unambiguous, I think referencing a particular wiki as source is better, because it provides a better fallback than English if no article in the user's target language is available. Of course, using Wikidata as the intermediate stage to go from one language to another makes perfect sense.

Oh, and as long as Chris gets to ask for a pony, I want to ask for a notice on the target page that shows the original link, like a redirect notice, such as "(Shared from German Wikipedia Gift)" or "(Shared from English Wikipedia Gift)"—or whatever wording makes sense.

Yeah, indicating a specific wiki as a source would be a good solution.

Just to point out that QRpedia (wiki article) does something similar.

You can already use https://www.wikidata.org/wiki/Special:GoToLinkedPage for that. https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q42 for example links you to the English Wikipedia article about Douglas Adams. https://www.wikidata.org/wiki/Special:GoToLinkedPage/dewiki,enwiki,frwiki/Q42 should do the same with a fallback chain from German to English to French Wikipedia.