Permalink
Browse files

Fixed parsing language_COUNTRY locales in FacesConfigXml

  • Loading branch information...
1 parent 0b190e4 commit 0f554c0f61daecc5f410a7f76149218ddece546c @BalusC BalusC committed May 9, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/org/omnifaces/config/FacesConfigXml.java
@@ -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;
@@ -229,13 +230,13 @@ private static Document loadFacesConfigXml(ServletContext context) throws IOExce
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);

0 comments on commit 0f554c0

Please sign in to comment.