Page MenuHomePhabricator

Alternate URLs should be desktop-mobile-site-aware
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • In the mobile site, the alternate URLs give the desktop site URLs ( https://zh.wikipedia.org ).
  • Canonical URL is a desktop URL

What should have happened instead?:

...

  • Check hreflang links on separate URLs.

    When you use rel=hreflang link elements for internationalization, link between mobile and desktop URLs separately. Your mobile URLs' hreflang must point to mobile URLs, and similarly desktop URL hreflang must point to desktop URLs.

...

Software version (skip for WMF-hosted wikis like Wikipedia):

  • Site: Wikipedia-zh
  • MediaWiki 1.40.0-wmf.20 ( 212529a )
  • MobileFrontend 2.4.1 ( 3fd996a )

Other information (browser name/version, screenshots, etc.):

Acceptance criteria (AC):

  • Example page: https://zh.wikipedia.org/wiki/汉语 ( shortened as /wiki/汉语 format below )
Language variant in URLActionlink rel="canonical"link rel="alternate" hreflang="zh-Hant-TW"Notes
non-specifiedview/wiki/汉语/zh-tw/汉语
zh-twview/zh-tw/汉语/zh-tw/汉语
non-specifiededit/wiki/汉语/zh-tw/汉语See T67402
zh-twedit/zh-tw/汉语/zh-tw/汉语for consistency
non-specifiedhistory/w/index.php?title=汉语&action=history(without HTML meta alternate tag)See Func's cmt.
zh-twhistory/w/index.php?title=汉语&action=history(without HTML meta alternate tag)See Func's cmt.
non-specifiedinfo/w/index.php?title=汉语&action=info(without HTML meta alternate tag)See Func's cmt.
zh-twinfo/w/index.php?title=汉语&action=info(without HTML meta alternate tag)See Func's cmt.

I think we don't need to append the variant parameter to the history or info page,
variants only make sense when editing or viewing the page.

NOTE: Maybe we should prefer to use the BCP 47 code for language variant path?
NOTE: Maybe we would like to introduce new configuration option(s) to exclude some of the language variants?

Version: 1.23.0
Severity: normal
See Also:

Event Timeline

Jdlrobson changed the task status from Open to Stalled.Feb 22 2023, 8:01 PM
Jdlrobson subscribed.

I talked to one of Google's developers who works on the indexing engine about this today, and there is no technical reason we need to do this. I've requested they write a blog post so that I can properly source this before declining this ticket.

I talked to one of Google's developers who works on the indexing engine about this today, and there is no technical reason we need to do this. I've requested they write a blog post so that I can properly source this before declining this ticket.

It would be good to ask about the thing wrote in https://developers.google.com/search/docs/crawling-indexing/mobile/mobile-sites-mobile-first-indexing#additional-best-practices .

I've reached out and the answer I've heard is that "The documentation predates mobile first, so these subtle topics are not covered. I am scoping what can be published fast."
I'm not sure how fast we can expect this though.

Jdlrobson claimed this task.

Trusting the documentation will be improved. If it doesn't please let me know and I'll reach out again to my Google contact.