As a Lexeme creator I want the spelling variant of my Lexeme to be inferred from the language of the Lexeme if possible.
Problem:
We want to get the spelling variant from the Item of the language if possible.
BDD
GIVEN the Special:New Lexeme page
WHEN the editor selects the language of the Lexeme
AND the language’s Item has a P218 (ISO 639-1 code) statement
THEN we use the value of that statement as the spelling variant of the new Lexeme
AND the spelling variant lookup is not shown
Acceptance criteria:
- spelling variant is inferred from the Item for the language
- spelling variant input is not shown when it can be inferred from the language’s Item
- the inferred language code needs to be validated. A warning attached to the Language input field is shown ("This Item has an unrecognized language code. Please select one below.") when the language code is not valid and the spelling variant input is shown.
Notes:
- this is supposed to work exactly like in the current implementation of Special:New Lexeme
- The Property used should be https://www.wikidata.org/wiki/Property:P218 (double check this in the existing implementation)
- the spelling variant input field is hidden by default and only shown when the spelling variant cannot be inferred from the thing
- task covers the inference and visibility