Cache result of Language::isValidCode() to avoid regex processing