Page MenuHomePhabricator

Extra space in property scope constraint message
Closed, ResolvedPublic2 Estimated Story Points

Description

The error for the property scope constraint is showing should not be used in this location (as main value ). with an extra space before the closing bracket.

Screenshot from https://www.wikidata.org/wiki/Q5963198#P8991:

Bildschirmfoto_2021-09-23_10-26-03.png (223×728 px, 32 KB)

Event Timeline

Aha, I see what's happening. When it falls back to a variant of the same language, we don't show the language name but the language name is still there in the HTML, preceded by a space.

I'm seeing it for en-gb, en-ca, de-ch and de-at at least, so you should be able to reproduce it if you go to https://www.wikidata.org/wiki/Q5963198?uselang=en-gb#P8991 or https://www.wikidata.org/wiki/Q5963198?uselang=de-ch#P8991

Ah, and we CSS-hide the language fallback indicator itself, but not the space before it…

Would there be any issue with just moving the space inside the <sup class="wb-language-fallback-indicator wb-language-fallback-variant">, so that it gets hidden as well? (In general, not just in constraint messages.)

Task breakdown notes:

  • The example item currently linked in the task description no longer works, but it should be possible to reproduce the issue on the sandbox item or on Test Wikidata.
  • Let’s move the space inside the <sup> element.

I added an example to the sandbox item: https://www.wikidata.org/wiki/Q4115189?uselang=en-gb#P8991

I also notice that the “fallback language” indicator actually has even worse spacing when it is visible, because it has a margin-right: 0.5em:

image.png (167×402 px, 21 KB)

Also, this was actually touched relatively recently (2020): T256857: Separate language from title in the displayed label

Hm, there’s one case where moving the space inside the indicator changes its size more significantly: the heading.

image.png (34×303 px, 5 KB)

Previously:
image.png (34×307 px, 5 KB)

Is this still okay, or do we need to split the markup so that the space can be inside the display: none element but without the smaller font size?

Change 869752 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Fix spacing of language fallback indicator

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

Change 869774 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseCirrusSearch@master] Temporarily skip fallback indicator tests

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

Change 869775 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseCirrusSearch@master] Reenable fallback indicator tests

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

Change 869817 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] Temporarily skip fallback indicator tests

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

Change 869818 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] Reenable fallback indicator tests

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

Change 869774 merged by jenkins-bot:

[mediawiki/extensions/WikibaseCirrusSearch@master] Temporarily skip fallback indicator tests

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

Change 869817 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Temporarily skip fallback indicator tests

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

Change 869752 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Fix spacing of language fallback indicator

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

Change 869818 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Reenable fallback indicator tests

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

Change 869775 merged by jenkins-bot:

[mediawiki/extensions/WikibaseCirrusSearch@master] Reenable fallback indicator tests

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