Page MenuHomePhabricator

Make space in lexeme header localizable
Closed, ResolvedPublic

Description

The lexeme header has spaces after the “language” and “lexical category” fields (example from L1:

Screenshot from 2022-11-07 12-11-16.png (209×493 px, 14 KB)

Screenshot from 2022-11-07 12-11-14.png (209×493 px, 20 KB)

These spaces are currently just hard-coded in the HTML template (in fact, we had to fix the template so the spaces wouldn’t get removed under Vue 3). They should be translatable – some languages (such as Chinese, I believe) don’t need a space there.

Event Timeline

Personally, I’d also like to see some punctuation there – I think the colon-separator message (English: “: ”) would work well here (“Language: Sumerian”).

Change 879934 had a related patch set uploaded (by Sushrith Bogi; author: Sushrith Bogi):

[mediawiki/extensions/WikibaseLexeme@master] lexeme header:Add a colon-separator to the lexeme header "language"

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

Hi @Lucas_Werkmeister_WMDE
Could you please provide me how the colon must be added other than hard-coding and where the spaces are supposed to be present?

The colon-separator message should be used, and there should not be any spaces around the message in the template (the spaces should come from the message itself).

1F616EMO subscribed.

Got a patch, but I am unable to upload it as I am not a Trusted-Contributors. I will upload it once I am in that group. Uploaded.

Test wiki created on Patch demo by 1F616EMO using patch(es) linked to this task:
https://b31ad97c4e.catalyst.wmcloud.org/w/

Test wiki on Patch demo by 1F616EMO using patch(es) linked to this task was deleted:

https://b31ad97c4e.catalyst.wmcloud.org/w/

On the earliest patch, some JavaScript was loaded that completely removed the colon, leaving behind just an empty span. My latest patch removed the span tags around the colon separator to fix spacing issues, and I wonder if that fixes the issue, but unfortunately, I do not have time to set up a testing environment locally.

So now the spacing of the original HTML output is fixed, but the JS simply kills the colon, see https://b40ca3c771.catalyst.wmcloud.org/wiki/Lexeme:L1. I wonder why...

So now the spacing of the original HTML output is fixed, but the JS simply kills the colon, see https://b40ca3c771.catalyst.wmcloud.org/wiki/Lexeme:L1. I wonder why...

I think this was because the colon-separator message wasn’t sent to the client side yet; the latest patch set (which fixed that) is working for me as it should.

Change #879934 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] lexeme header: Add a colon-separator to the lexeme header "language"

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

No problem! But let’s leave the task open so the PM can verify it (e.g. on Beta) :)

Compare for example the “language” and “lexical category” fields on Beta L1 (in Chinese) with Wikidata (archived, in Chinese, archived in Chinese).