refactor(language): Test/improve tests on languages middleware (#4980)