Skip to content

Commit

Permalink
Fixed parsing language_COUNTRY locales in FacesConfigXml
Browse files Browse the repository at this point in the history
  • Loading branch information
Bauke Scholtz committed May 9, 2016
1 parent 0b190e4 commit 0f554c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/omnifaces/config/FacesConfigXml.java
Expand Up @@ -14,6 +14,7 @@

import static org.omnifaces.util.Faces.getServletContext;
import static org.omnifaces.util.Faces.hasContext;
import static org.omnifaces.util.Utils.parseLocale;
import static org.omnifaces.util.Xml.createDocument;
import static org.omnifaces.util.Xml.getNodeList;
import static org.omnifaces.util.Xml.getTextContent;
Expand Down Expand Up @@ -229,13 +230,13 @@ private static List<Locale> parseSupportedLocales(Element facesConfigXml, XPath
String defaultLocale = xpath.compile(XPATH_DEFAULT_LOCALE).evaluate(facesConfigXml).trim();

if (!Utils.isEmpty(defaultLocale)) {
supportedLocales.add(new Locale(defaultLocale));
supportedLocales.add(parseLocale(defaultLocale));
}

NodeList supportedLocaleNodes = getNodeList(facesConfigXml, xpath, XPATH_SUPPORTED_LOCALE);

for (int i = 0; i < supportedLocaleNodes.getLength(); i++) {
Locale supportedLocale = new Locale(getTextContent(supportedLocaleNodes.item(i)));
Locale supportedLocale = parseLocale(getTextContent(supportedLocaleNodes.item(i)));

if (!supportedLocales.contains(supportedLocale)) {
supportedLocales.add(supportedLocale);
Expand Down

0 comments on commit 0f554c0

Please sign in to comment.