Page MenuHomePhabricator

Link to sr does not appear in ULS Compact Links
Closed, ResolvedPublic

Description

I. Observed: the language code is 'sr' appears in the sidebar, because the article is available in it and linked in Wikidata.

Note that this bug is not about Serbocroatian ("Srpskohrvatski / српскохрватски") - this language does appear.

  • Enable Compact Language Links
  • Go to https://en.wikipedia.org/wiki/Novi_Sad
  • Click "65 more" (or other count) in the "other languages" interlanguage interwiki list of the sidebar.
  • Type "sr" or "Српски" in the search bar.

II. Expected: a link to Serbian ("Српски / srpski") appears.
III. Observed: only Srpskohrvatski appears.

This is on the verge of "Unbreak Now!" because thousands of users enabled this Beta Feature, and it's not showing a language.

Event Timeline

Amire80 created this task.May 22 2015, 7:06 AM
Amire80 raised the priority of this task from to High.
Amire80 updated the task description. (Show Details)
Amire80 added subscribers: Liuxinyu970226, Amire80, santhosh and 4 others.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 22 2015, 7:06 AM
Amire80 updated the task description. (Show Details)May 22 2015, 7:11 AM
Amire80 set Security to None.

This reminds me of T50804 and is possibly the same underlying issue.

If we enter the entire term "srpski" in the search bar, it does turn up as Српски
Makes me wonder if this is a ULS issue.

Ijon updated the task description. (Show Details)May 23 2015, 2:36 AM
jayvdb added a subscriber: jayvdb.Jun 20 2015, 3:35 AM
Nemo_bis updated the task description. (Show Details)Dec 11 2015, 11:49 AM
Nemo_bis updated the task description. (Show Details)Dec 11 2015, 11:51 AM

In MediaWiki, "sr" is Cyrillic by default and falls back to "sr-ec":

	'sr' => 'српски / srpski',	# Serbian (multiple scripts - defaults to Cyrillic)
	'sr-ec' => "српски (ћирилица)\xE2\x80\x8E",	# Serbian Cyrillic ekavian
	'sr-el' => "srpski (latinica)\xE2\x80\x8E",	# Serbian Latin ekavian

The same is true in Wikimedia: https://sr.wikipedia.org/w/api.php?action=query&meta=siteinfo

In langdb, both are mapped to sr-cyrl: https://github.com/wikimedia/jquery.uls/blob/423b533b7066e3c230186251b46b4ec099842008/data/langdb.yaml#L455

The CLDR locale has code "sr" and is also Cyrillic.

Data is all correct and in agreement. This might simply be an overflow bug where only the first matching language is shown and for some reason "sh" is the first match when searching "sr".

Nemo_bis lowered the priority of this task from High to Normal.Dec 11 2015, 12:15 PM

I'm reducing priority because there is a workaround and it's also a rather obvious one, i.e. searching for full name of the language. I don't think that most users are expected to scan the entire list of languages and I suspect only power users would (only) search the language code.

Well that workaround is not at all obvious, since while entering "sr", "srp", "srps" etc. only "srpskohrvatski" would appear, leading users to think there is no Serbian. It's not just that the search by language code fails, it's that the search by prefix fails too.

Amire80 raised the priority of this task from Normal to High.Mar 26 2016, 4:03 PM
Amire80 moved this task from Backlog to Missing languages on the ULS-CompactLinks board.

Change 281125 had a related patch set uploaded (by Nemo bis):
Resolve language code redirects before looking them up in ULS data

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

Change 281126 had a related patch set uploaded (by Nemo bis):
Resolve language code redirects before looking them up in ULS data

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

Change 281125 abandoned by Nemo bis:
Resolve language code redirects before looking them up in ULS data

Reason:
Sorry, duplicate

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

santhosh claimed this task.Apr 4 2016, 6:47 AM

Nemo said in commit a1cbe3ba77c3a585509ac067bf538c2b6ae81c79 / https://gerrit.wikimedia.org/r/#/c/281126/2

Resolve language code redirects before looking them up in ULS data
CompactInterlanguageList assumes that the language code is what the
MediaWiki HTML contains, especially in getInterlanguageList() and
showLanguage(). The code can be a macro code which falls back to a
specific code (like "sr") or a special language code.
https://meta.wikimedia.org/wiki/Special_language_codes
When filtering the available languages (from the interwiki links list),
keep the original codes and check the ULS data for the code as stored
in ULS data, by resolving the redirect.
Language codes which alias to other codes are never returned by
$.uls.data.getLanguages* functions. RegionSelector and others may
need to check their assumptions.

Change 281126 merged by jenkins-bot:
Resolve language code redirects before using them in ULS

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

Nikerabbit renamed this task from [Compact links] an interlanguage link to Serbian doesn't appear in compact links to Link to sr does not appear in ULS Compact Links.Apr 12 2016, 6:50 AM
Arrbee closed this task as Resolved.Apr 19 2016, 4:46 AM
Arrbee moved this task from QA to Done on the Language-Q4-2016-Sprint 1 board.