You have another PR for adding a language switcher to pages that does something similar right? This work should be integrated so that the lang files are not checked multiple times per request.