/related/ reads do not validate langCode: an unconfigured language returns 404 or 200-with-omissions instead of 422
Individual and collection reads validate the language selector through one shared resolver, so an unconfigured langCode is rejected with 422 and a detail naming the language. getRelated() read the query parameter raw and never validated it, so the same typo produced a different and misleading answer depending on the relationship's cardinality: a to-one relationship returned 404 ("the translation does not exist"), indistinguishable from a genuinely missing translation of a configured language, and a to-many relationship returned 200 with every target moved into meta.omitted and reported as a language miss. Both answers blamed the content when the request had named a language the site does not have.
Resolve the selector once through getResourceLanguage() instead. It is memoized per request and already runs on the two sibling endpoints, so this adds no query and changes nothing for well-formed requests. The error detail is not re-authored: the test references the same literal the individual endpoint's assertion uses, so the two cannot drift apart.
No header guards are added. Language request headers are deliberately inert on reads since #3613823, and #3614200 retired Content-Language as a write selector; routing through the shared resolver does not reintroduce a header rejection here, because that rejection is gated on the request not being cacheable and so applies to writes only. Genuinely missing translations of configured languages keep their current behavior.
Side effect worth having: the resolver throws a CacheableUnprocessableEntityHttpException carrying the config:configurable_language_list cache tag, so the related endpoint's rejection is now cacheable and self-invalidating when the language is later added, matching its sibling endpoints.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Closes #3614384