Page MenuHomePhabricator

Fall back to local english message for example Lexeme ID
Closed, DeclinedPublic8 Estimated Story Points

Description

As a Wikidata editor, I want the example Lexeme shown in the info panel on Special:NewLexemeAlpha (soon to be Special:NewLexeme) prefer a message defined on-wiki over the default one defined in the software.

As a Wikidata interface administrator, I don’t want to have to create hundreds of pages in the MediaWiki: namespace just to ensure that users see at least a rudimentary useful example Lexeme on the special page.

Problem:
The example lexeme ID is configured using the wikibaselexeme-newlexeme-info-panel-example-lexeme-id interface message, which defaults to L1 in the extension’s source code (en.json), but which we intend to be overridden on each wiki in the MediaWiki: namespace. Currently on Wikidata, MediaWiki:Wikibaselexeme-newlexeme-info-panel-example-lexeme-id is set to L7 (English noun “cat”), which is a useful example Lexeme for users who look at the page in English. When you load the special page in a language where no specific example lexeme ID has been set in the MediaWiki: namespace yet, we expect the ID to fall back to the English MediaWiki: page, which is still more useful than L1 (Sumerian noun “ama”/“𒂼”). However, this doesn’t happen: apparently, when MediaWiki applies language fallbacks for a message, it only uses the JSON message files and ignores MediaWiki: namespace pages that exist for the fallback languages.

Example:
The special page in Portuguese currently shows L1:

image.png (326×856 px, 37 KB)

We would like it to show L7 instead, which is likely to be more useful than L1 to Portuguese speakers.

BDD
GIVEN my user interface is in a language other than English
AND no example Lexeme ID has been configured in that specific language yet
WHEN I load Special:NewLexemeAlpha (soon to be Special:NewLexeme)
THEN the info panel shows the example Lexeme defined in the local English message

Acceptance criteria:

  • The example lexeme ID falls back to the English message in the MediaWiki: namespace before resorting to the extension’s en.json file.

Note:
We want this to ultimately support the full language fallback chain. This is an intermediate step to improve the situation. See T313599 is for supporting the full fallback chain.

Event Timeline

karapayneWMDE set the point value for this task to 8.Aug 23 2022, 8:54 AM
karapayneWMDE subscribed.

sprint 4 planning : estimation 5 - 8

Task Breakdown Notes:

  • there's still things to uncover with regards to how this currently works
  • we should look into how core handles checking for the existence of local overrides
  • this might end up being done as a service that checks for configured custom language overrides in <user language> and if that doesn't exist then in English, etc.

If we do this as a service, then I think we should make it a service specific to an example lexeme ID, and not a general-purpose “use this for different language fallback behavior” service that could be used for other messages. That (hopefully) lets us avoid the complexity of LanguageConverter (I have no idea how that factors into messages in general, to be honest).

Boldly closing this in favor of T313599: Special:NewLexemeAlpha example lexeme ID does not fall back to other MediaWiki: pages, since I just found a solution that supports full language fallbacks, not just to English.