private static Optional<String> findLocale(final String locale, final List<?> items) {
        LOGGER.trace("Looking for locale [{}]", locale);
        val p = Pattern.compile(locale, Pattern.CASE_INSENSITIVE);
        return items.stream()
            .filter(LocalizedName.class::isInstance)
            .map(LocalizedName.class::cast)
            .filter(item -> {
                val xmlLang = item.getXMLLang();
                return StringUtils.isNotBlank(xmlLang) && p.matcher(xmlLang).matches() && StringUtils.isNotBlank(item.getValue());
            })
            .map(XSString::getValue)
            .findFirst();
    }
Gets localized values.

@param locale browser preferred language
@param items  the items
@return the string value
support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/SamlMetadataUIInfo.java