Extracted language preference middleware to its own repo