private function isValidLocale($lang) { return (bool) preg_match('/^([a-z]{2})(-[A-Z]{2})?$/', $lang); }