Page MenuHomePhabricator

Use hyphenation for long sense gloss
Closed, ResolvedPublic2 Story Points

Description

BDD

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

Info

  • 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)

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseLexeme : masterUse hyphen for glosses

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptAug 31 2018, 11:55 AM
Pablo-WMDE updated the task description. (Show Details)Aug 31 2018, 12:23 PM
Ladsgroup moved this task from To Do to Doing on the Wikidata-Senses-Iteration4 board.
Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptSep 4 2018, 12:00 PM

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

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

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

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

@Lucas_Werkmeister_WMDE

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:

@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. https://caniuse.com/#feat=css-hyphens
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. https://stackoverflow.com/questions/43809612/prevent-a-child-element-from-overflowing-its-parent-in-flexbox

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 removed Ladsgroup as the assignee of this task.Sep 11 2018, 10:04 AM
Ladsgroup added a subscriber: Ladsgroup.
Lucas_Werkmeister_WMDE closed this task as Resolved.Sep 17 2018, 10:28 AM
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.