### Background
See {T341244}. In a nut shell, it is (unfortunately) common today for extensions to try to "guess" the language and directionality of embedded content. The reason for this is largely that a better API didn't exist, and classes like `mw-content-ltr` are important to set for correct styling, and are difficult to set by any means other than `Title::getPageViewLanguage`. But, Title::getPageViewLanguage involves global state and a lot of guess work.
### Scope
https://codesearch.wmcloud.org/deployed/?q=%3EgetPageViewLanguage
* [x] EventLogging (MetricsPlatform/ContextAttributesFactory.php). #data-engineering
** https://gerrit.wikimedia.org/r/c/mediawiki/extensions/EventLogging/+/976877
* [x] TemplateSandbox (Hook, SpecialPage). **Unassigned: No owner**.
** https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TemplateSandbox/+/973278
* [ ] Wikibase (EntityHandler.php). #wikidata
* [ ] CommonsMetadata (Hook). #structured_data_engineering
* [x] DiscussionTools (SpecialDiscussionToolsDebug.php). #editing-team
** https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/973276
* [x] Scribunto (ScribuntoContentHandler.php). **Unassigned: No owner**.
** https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Scribunto/+/974276
### Outcome
Remove use of Title::getPageViewLanguage.
Example migration:
* **HTML workarounds**: In cases where it is used to manually create CSS classes like `mw-content-ltr` and `mw-parser-output`, and the `lang` and `dir` attributes, this can probably removed given that nowadays ParserOutput will take care of setting these already. Be sure to test the end-user workflow and confirm that your workarounds are redundant before removing them. When not possible to remove or if not feasible in the short-term, at least use `ParserOutput->getLanguage()` to inform your current workarounds instead of the global guesswork from Title::getPageViewLanguage.
* **Language code**. If using Title::getPageViewLanguage to associate page language outside a pageview perspective, it is likely incorrect. Consider using `Title->getPageLanguage()` instead.