Page MenuHomePhabricator

Use hyphenation for long sense gloss
Closed, ResolvedPublic2 Estimated Story Points



GIVEN I am on a Lexeme page with a sense
WHEN a sense gloss is too long to fit the available width
THEN this sense gloss is hyphenated according to the rules suitable for its language

Acceptance criteria:

  • Long sense gloss overflow to the next line in the widget
  • Long sense gloss do not hide the cancel/save buttons


  • subject was researched in T199078. Recommendation is to use the .hyphens mixin provided by MW on .wb-lexemepage .wikibase-lexeme-sense-gloss-value. In order for this to work these nodes need to be marked-up with the correct language(, and directionality)

Event Timeline

Change 457887 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/WikibaseLexeme@master] Use hyphen for glosses

TBH I don’t see what the directionality has to do with this, as far as I understand only the language is relevant for hyphenation.

Change 457887 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Use hyphen for glosses


I don’t see what the directionality has to do with this

That's why it is not mentioned in the AC I put it in brackets in the info block. It's an attribute to the same node that can be derived from the language - so it seems a tempting by-catch which went wrong before, so I deemed it worth mentioning... T203384 (merged into T203081 since).

This seems to not yet work in Chrome for me. It does work for Lemmas. Pablo says Jakob applied some more magic there. It should probably be applied here too.

I’m not seeing any hyphenation in Chromium for lemmas, representations or glosses:

Screenshot from 2018-09-10 16-22-18.png (771×855 px, 80 KB)

@Jakob_WMDE what kind of special magic did you apply? Is it the white-space: nowrap in Id3cee24959?

@Lucas_Werkmeister_WMDE no magic, unfortunately. Hyphens don't work in chrome/chromium yet.
The fallback that mediawiki's .hyphens mixin uses is word-wrap: break-word afaik and the initial patch had some issues with flexbox width, which were solved by all these min-width: 0 fixes.

Okay, thanks (the MDN compatibility data misled me, I thought Chromium supported it). But as far as I can see, glosses and representations behave equivalently right now (see screenshot), so is there anything left for us to do here?

Ladsgroup added a subscriber: Ladsgroup.
Lucas_Werkmeister_WMDE claimed this task.
Lucas_Werkmeister_WMDE moved this task from Doing to Done on the Wikidata-Senses-Iteration4 board.

@Lydia_Pintscher points out that lemmas, representations and glosses all behave equivalently in Chromium right now – the reason why the lemma is letter-broken in the screenshot above and the representations and the glosses aren’t is that the lemma is just one word. But that means there’s nothing more for us to do here, and we can close this.