Move language validation to its own function