Fix and refactor default lang middleware

A tiny fix plus cleanup code.

Merge request reports

Loading