Page MenuHomePhabricator

Automatically normalize lowercase and uppercase in Lexeme language code when saving instead of showing an error
Closed, DuplicatePublic

Description

From https://phabricator.wikimedia.org/T268689#8036398

Subtask 2: Automatically normalize (mis-x- lowercase, Qid uppercase) when saving instead of showing an error:

  • everything is supposed to be lowercase except the uppercase Q (e.g. when the user enters en-GB then just save this as en-gb)
  • This might have to happen in ChangeOpLemmaEdit
  • reverts are handled by reverting to the original version without normalization
  • for existing qids which don't fit the standarized way = they will be updated by the community after this is released
  • We will display the language code in the way they were originally saved to allow the community to fix

Example:

  • HE-X-Q21283070 -> he-x-Q21283070
  • he-x-q21283070 -> he-x-Q21283070
  • He-X-q21283070 -> he-x-Q21283070

Notes:

Event Timeline

karapayneWMDE created this task.

During sprint planning we broke the original task into two. Here is the second half for you to prioritize as is fitting!

Manuel renamed this task from Automatically normalize lowercase q in item IDs to uppercase Q when saving instead of showing an error to Automatically normalize lowercase and uppercase in Lexeme language code when saving instead of showing an error.Oct 4 2022, 8:48 AM
Manuel updated the task description. (Show Details)

Note from story writing: if we do this in the API backend, we need to consider what happens when users send JSON payloads like

"lemmas": {
    "en-gb": { "value": "X", "language": "en-gb" },
    "en-GB": { "value": "Y", "language": "en-GB" }
}