The SkinTemplateOutputPageBeforeExec hook is being deprecated as part of desktop refresh to simplify skin integration points which will make it much easier for skins to be built.
For similar reasons given in T252841 and [[ https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/596522/4/includes/skins/SkinTemplate.php@557 | discussions with Timo in this Gerrit patch ]] the SkinTemplateOutputPageBeforeExec hook should not be used to force the display of the language portal. That is a decision that should rest with the skin.
Vector will currently display the portal provided either the language overlay is full or the BaseTemplateAfterPortlet hook is used to inject content at the end of the language portal.
Monobook, CologneBlue, Modern will not, however they can be patched to do so (also feel free to jump in with your own thoughts in [[ https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/596522/4/includes/skins/SkinTemplate.php@557 | discussions with Timo in this Gerrit patch ]] about whether this decision should rest in core)
Regardless of that decision UniversalLanguageSelector should replace SkinTemplateOutputPageBeforeExec with BaseTemplateAfterPortlet - I have provided two possible options to show how that might be done. Let me know what you think.
I'm targeting the 1.35 release for deprecating this hook. Let me know if you see any problems with that! Thanks in advance!