Page MenuHomePhabricator

Check gloss language codes in UI
Closed, ResolvedPublic

Event Timeline

WMDE-leszek subscribed.

@Lydia_Pintscher please define what error message should say, and how it should look like

@WMDE-leszek I think the BDD in the story (T198036) is enough:

GIVEN I am on a Lexeme page
AND I edit a Gloss
WHEN I enter a language that is not considered valid
THEN the field is highlighted in red
AND the save button is grayed out

I think we can use the HTML5 constraint validation API for this – the only MediaWiki Grade A browsers that don’t support it according to caniuse.com are Chrome 13-14 (supported since Chrome 15) and Safari 5 (supported since Safari 5.1). (Some features are missing in a few more browser versions, but we should only need a baseline: setCustomValidity( 'unknown language code' ) and the :valid/:invalid selectors.)

Of course, that assumes that we use a proper form for editing glosses… do we?

Of course, that assumes that we use a proper form for editing glosses… do we?

Of course we don’t, what was I thinking.

Well, we don’t really need there to be a form, that just means we’ll have to do manual work to disable the “save” button.

Ladsgroup moved this task from To Do to Doing on the Wikidata-Senses-Iteration4 board.

I give this a try.

Change 459796 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/WikibaseLexeme@master] [WIP] Start InvalidLanguageIndicator and use it in glosses

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

Change 459796 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Add InvalidLanguageIndicator and use it in glosses

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