Page MenuHomePhabricator

Use <link rel="alternate"> for language-variant links
Closed, ResolvedPublic

Description

Author: andy

Description:
For each variant link, for example:

<a
href="/zh-tw/Wikipedia:%E4%BA%92%E5%8A%A9%E5%AE%A2%E6%A0%88/%E6%B6%88%E6%81%AF"

台灣正體</a>

add a <link> element to the <head> section of the document, thus:

<link href="/zh-tw/A" lang="zh-tw" hreflang="zh-tw" rel="alternate" title="台灣正體">

Bug 24742 is similar, but does not cover link headers.


Version: unspecified
Severity: enhancement

Details

Reference
bz27362

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:14 PM
bzimport set Reference to bz27362.

Already implemented in r74827

andy wrote:

Is 74827 the correct number? I can't see anything about rel-alternate there.

andy wrote:

I was actually thinking of what's requested in Bug 4901 - "lang and hreflang attributes for interwiki links", to which I've added a request for rel="alternate"

Although this is marked "closed", no such headers are currently in the source of, for example:

https://en.wikipedia.org/wiki/Tim_Berners-Lee

@Pigsonthewing Because english doesn't have language variants. See https://zh.wikipedia.org/wiki/蒂姆·伯纳斯-李

There's some ticket about linking to all the other languages, but we never went through with it because:

  1. It's not a real alternate (the other languages are not variants of the same content, they are unique content)
  2. duplicating the list of languages in the <head> element of the page is 'expensive'.
  3. the list of languages is already in the page, and those links are marked up with hreflang attribute.