deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-631 optional check of supported locales
Date Sat, 07 Jun 2014 10:46:18 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master e24517ea0 -> 7eeb21102


DELTASPIKE-631 optional check of supported locales


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/7eeb2110
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/7eeb2110
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/7eeb2110

Branch: refs/heads/master
Commit: 7eeb2110229e2390dacb4772cc421f6f09134b35
Parents: e24517e
Author: gpetracek <gpetracek@apache.org>
Authored: Sat Jun 7 12:45:14 2014 +0200
Committer: gpetracek <gpetracek@apache.org>
Committed: Sat Jun 7 12:45:14 2014 +0200

----------------------------------------------------------------------
 .../deltaspike/jsf/impl/message/JsfAwareLocaleResolver.java   | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/7eeb2110/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/message/JsfAwareLocaleResolver.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/message/JsfAwareLocaleResolver.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/message/JsfAwareLocaleResolver.java
index c7ad93b..6f9b7ca 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/message/JsfAwareLocaleResolver.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/message/JsfAwareLocaleResolver.java
@@ -51,13 +51,20 @@ public class JsfAwareLocaleResolver extends DefaultLocaleResolver
             {
                 Iterator<Locale> supportedLocale = facesContext.getApplication().getSupportedLocales();
 
+                boolean supportedLocaleConfigured = false;
                 while (supportedLocale.hasNext())
                 {
+                    supportedLocaleConfigured = true;
                     if (result.equals(supportedLocale.next()))
                     {
                         return result;
                     }
                 }
+
+                if (!supportedLocaleConfigured)
+                {
+                    return result;
+                }
             }
 
             result = facesContext.getApplication().getDefaultLocale();


Mime
View raw message