Unico Hommes pushed to branch master at cms-community / hippo-cms

Commits:
bdd8a8f2 by Unico Hommes at 2016-04-28T14:29:25+02:00
CMS-10081
- default locales only includes english
- get included cms locales configuration from global settings

- - - - -


2 changed files:

- config/src/main/resources/cms-settings.xml
- engine/src/main/java/org/hippoecm/frontend/plugins/login/LoginPlugin.java


Changes:

=====================================
config/src/main/resources/cms-settings.xml
=====================================
--- a/config/src/main/resources/cms-settings.xml
+++ b/config/src/main/resources/cms-settings.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright 2015 Hippo B.V. (http://www.onehippo.com)
+  Copyright 2015-2016 Hippo B.V. (http://www.onehippo.com)
 
   Licensed under the Apache License, Version 2.0 (the  "License");
   you may not use this file except in compliance with the License.
@@ -21,4 +21,7 @@
   <sv:property sv:name="send.usage.statistics.to.hippo" sv:type="Boolean">
     <sv:value>true</sv:value>
   </sv:property>
+  <sv:property sv:name="locales" sv:type="String" sv:multiple="true">
+    <sv:value>en</sv:value>
+  </sv:property>
 </sv:node>


=====================================
engine/src/main/java/org/hippoecm/frontend/plugins/login/LoginPlugin.java
=====================================
--- a/engine/src/main/java/org/hippoecm/frontend/plugins/login/LoginPlugin.java
+++ b/engine/src/main/java/org/hippoecm/frontend/plugins/login/LoginPlugin.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2010-2015 Hippo B.V. (http://www.onehippo.com)
+ *  Copyright 2010-2016 Hippo B.V. (http://www.onehippo.com)
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -41,6 +41,7 @@ import org.hippoecm.frontend.plugin.IPluginContext;
 import org.hippoecm.frontend.plugin.config.IPluginConfig;
 import org.hippoecm.frontend.plugins.standards.list.resolvers.CssClass;
 import org.hippoecm.frontend.service.render.RenderPlugin;
+import org.hippoecm.frontend.settings.GlobalSettings;
 import org.hippoecm.frontend.usagestatistics.UsageStatisticsSettings;
 
 public class LoginPlugin extends RenderPlugin {
@@ -54,9 +55,8 @@ public class LoginPlugin extends RenderPlugin {
     private static final String AUTOCOMPLETE = "signin.form.autocomplete";
     private static final String LOCALES = "locales";
     private static final String SUPPORTED_BROWSERS = "browsers.supported";
-
-    // Sorted by alphabetical order of the language name (see i18n 
properties), for a more user-friendly form
-    public static final String[] DEFAULT_LOCALES = {"en", "fr", "nl", "de"};
+    
+    public static final String[] DEFAULT_LOCALES = {"en"};
 
     private ResourceReference editionCss;
     private PageParameters parameters;
@@ -92,8 +92,8 @@ public class LoginPlugin extends RenderPlugin {
         add(termsAndConditions);
 
         final boolean autoComplete = 
getPluginConfig().getAsBoolean(AUTOCOMPLETE, true);
-        String[] localeArray = getPluginConfig().getStringArray(LOCALES);
-        if (localeArray == null) {
+        String[] localeArray = GlobalSettings.get().getStringArray(LOCALES);
+        if (localeArray == null || localeArray.length == 0) {
             localeArray = DEFAULT_LOCALES;
         }
         add(createLoginPanel("login-panel", autoComplete, 
Arrays.asList(localeArray), new LoginPluginHandler(termsAndConditions)));



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-cms/commit/bdd8a8f26a96a3e4c579379678ab30266d784e31
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to