User:SPage (WMF)/Api help test

outputs to transclude api.php help documentation into wiki pages.


 * T89680

Localization tests
See T89768 about localization problems

Special:ApiHelp redirects to api.php?action=help. The latter has great i18n and improving l10n, e.g. https://www.mediawiki.org/w/api.php?action=help&modules=query%2Bextracts&uselang=fr

The problem for transcluding Special:ApiHelp into localized pages is how to indicate the desired language and then getting the  code to.

Tests follow. I'm using uselang=es because someone has localized Api help into Spanish.

1.
Result: This doesn't work, because Title?QueryParams is a valid page name. Also, MediaWiki aggressively converts ?uselang=es into URL-encoded, so the query parameter doesn't even look like a query parameter.

2.
Result: The subpage handling is passed to Special:ApiHelp, but it doesn't detect the  as a parameter, and so tries and fails to load the bogus module "query+extracts?uselang=es". And again the $#@! URL-encoding. My 191250 attempts to fix this, though the suggestion is use pipe-separated arguments (see elsewhere).

3.
Result: I think the param gets passed the same way e.g.  works but ApiHelp doesn't respond.

4.
Result: I think the param gets passed, but it's not parsed.

using template
Either Api help needs a lang parameter, or the localized version Api help/es needs to modify the transclusion.

Invoke the localized subpage:
This works but we need a way to pass the language to the transclusion (tests above).

Should callers be using TNTN, does that call the localized template automatically?

In Engish
Template works fine in English