Page MenuHomePhabricator

Language name should be distinguished from the statement value when displaying monolingual text statements
Closed, ResolvedPublic

Description

Problem
When displaying a monolingual text statement, the language name should be visually distinguishable from the value.

At the moment, the language is displayed on the same line and in the same style as the value, so it's not clear that they are two separate things, and a monolingual text statement with the value "test" and language "English" looks identical to a string property with the value "test (English)".

This can be confusing and read as a value that includes an appended the language name.

Example screenshot:

Bildschirmfoto_2021-04-21_12-11-52.png (333×926 px, 18 KB)

Solution

The language should be marked as grey with a value of color-subtle. We'll use the necessary Codex token to update this style.

The solution suggested by @Nikki:
I've been using .wb-monolingualtext-language-name { color: grey; } to make the text grey for the language name and it's been a big improvement for me.

Example screenshot:

Bildschirmfoto_2021-04-21_12-33-50.png (332×927 px, 18 KB)

Event Timeline

Esc3300 subscribed.

Can we add it to the Wikidata's sitewide css?

Can we add it to the Wikidata's sitewide css?

I think that's best discussed on Wikidata itself and then a interface moderator can add it (if the community agrees on doing this).

After a short discussion, the members of the UX team agreed to proceed with this fix. Keeping accessibility in mind, we would encourage selecting a gray from our color palette that meets an acceptable contrast ratio: #72777d.

We recognize and are obliged to mention, nevertheless, that this relevant issue is a symptom of a broader underlying problem: the lack of semantic standards for the translation of data in Wikidata's user interface. We acknowledge that defining those standards and rethinking the UI would be quite a broader task, requiring the allocation of more time and resources.

a broader underlying problem: the lack of semantic standards for the translation of data in Wikidata's user interface

Has there been activity on this topic during the past two years? If it hasn't produced conflicting plans, I'd like to remind of the one-liner CSS above that has been accepted by the UX team with a tweak:

.wb-monolingualtext-language-name {
    color: #72777d;
}

Notes from Triage:

After a short discussion, the members of the UX team agreed to proceed with this fix. Keeping accessibility in mind, we would encourage selecting a gray from our color palette that meets an acceptable contrast ratio: #72777d.

Should we hard-code this color, or use a Codex token (now that Codex tokens are available, which they weren’t two years ago ^^)?

In Codex, #72777d is color.gray500, which is also color.placeholder or color.disabled (or border-color.interactive) – neither of them fits exactly, I think. color-subtle sounds like a decent semantic fit, but is defined as color.gray600, i.e. #54595d – is that close enough? (I found color-subtle via the deprecated color.base--subtle, which is also color.gray500 but says to use color-subtle instead.)

image.png (547×686 px, 40 KB)

Comparison on monolingual text (gray500 above, gray600 below):

image.png (228×242 px, 11 KB)

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

[mediawiki/extensions/Wikibase@master] Use different color for monolingual text language name

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

color-subtle sounds like a decent semantic fit, but is defined as color.gray600, i.e. #54595d – is that close enough?

Sorry for not reviewing the solution provided with the new guidelines in mind 😓
color-subtle is indeed the right fit here semantically, and what I would now recommend using in order to be aligned with the Wikimedia design system standards. One thing to keep in mind, though, is that the similar level of contrast of the two elements might not make them as easy to differentiate as we originally were aiming to:

Screenshot 2023-11-29 at 11.07.49.png (300×1 px, 38 KB)

Wondering specially if @Nikki would find this acceptable.

Should we hard-code this color, or use a Codex token (now that Codex tokens are available, which they weren’t two years ago ^^)?

My original inkling was to hard code, to avoid extra effort, but using Codex tokens might be a better idea for scalability and consistency! Doing so would be aligned with the effort to consolidate styling (i.e. replacing old variables and discrete values). We'll also soon have to start using said tokens in our domain, so making them available at this point in time sounds justifiable. I can update the task description if that's fine with @Michael and @Arian_Bozorg too.

I’m totally fine with either version (the codex tokens aren’t hard to use either). IMHO we could also go ahead with color-subtle now and change it later if needed.

Thanks so much everyone, I have added color-subtle to the description, but happy for you to update the description @Sarai-WMDE

Change 977703 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Use different color for monolingual text language name

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

Looking good! The color of the language name has been updated to #54595d, creating differentiation against the value. The right Codex token (@color-subtle) from mediawiki.skin.variables.less was used here. Thank you!

Arian_Bozorg claimed this task.

Looking good! Thank you

  NODES
COMMUNITY 1
Idea 1
idea 1
Note 5
Project 8