For most typical MediaWiki contexts (e.g. index.php, page views) the default languages for messages is the user language.
The Message class currently determines this via $wgLang (created in Setup.php) -> StubUserLang -> RequestContext::getMain()->getLanguage() -> getUser()->getOption('language').
For ResourceLoader (designed to be cookieless) the user language is specified via lang= query parameter. Typically retrieved via ResourceLoaderContext->getLanguage(), which in turn received it from load.php/WebStart/$wgRequest.
Instead of it working nicely by default in index.php and requiring ResourceLoader code to manually specify inLanguage( $context->getLanguage() ) we should be able to have the Message class (indirectly) get the appropiate default user language for a given request.
Right now the pattern if inLanguage() isn't being used and load.php will end up indirectly unstubbing $wgUser via Message/wgLang/StubUserLang->getLanguage->getUser->getOption - which is possibly even the wrong language and causing cache pollution if a session is present as it ignores ResourceLoaderContext.
In practice requests from sessioned users tend to be in their own preferred user language (unless they manually generate a different url), but this still needs fixing.