svn commit: r750632 - in /ofbiz/trunk/framework/webtools: config/ src/org/ofbiz/webtools/labelmanager/ webapp/webtools/WEB-INF/actions/labelmanager/ webapp/webtools/labelmanager/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r750632 - in /ofbiz/trunk/framework/webtools: config/ src/org/ofbiz/webtools/labelmanager/ webapp/webtools/WEB-INF/actions/labelmanager/ webapp/webtools/labelmanager/

jleroux@apache.org
Author: jleroux
Date: Thu Mar  5 22:17:09 2009
New Revision: 750632

URL: http://svn.apache.org/viewvc?rev=750632&view=rev
Log:
Add some informations for duplicated labels in Labels Manager

Modified:
    ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/LabelManager.groovy
    ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/SearchLabels.ftl

Modified: ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml?rev=750632&r1=750631&r2=750632&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml (original)
+++ ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml Thu Mar  5 22:17:09 2009
@@ -1467,6 +1467,10 @@
         <value xml:lang="fr">Nom de composant</value>
         <value xml:lang="it">Nome Componente</value>
     </property>
+    <property key="WebtoolsLabelManagerClearCacheAfterFixingDuplicateLabels">
+        <value xml:lang="en">Clear Cache After Fixing Duplicate Labels</value>
+        <value xml:lang="fr">Purgez les caches après avoir supprimé les traductions dupliquées</value>
+    </property>    
     <property key="WebtoolsLabelManagerFileName">
         <value xml:lang="en">File Name</value>
         <value xml:lang="fr">Nom de fichier</value>

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java?rev=750632&r1=750631&r2=750632&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java Thu Mar  5 22:17:09 2009
@@ -28,6 +28,8 @@
 import java.util.TreeMap;
 import java.util.TreeSet;
 
+import javolution.util.FastList;
+
 import org.ofbiz.base.component.ComponentConfig;
 import org.ofbiz.base.util.FileUtil;
 import org.ofbiz.base.util.GeneralException;
@@ -64,6 +66,7 @@
     protected static Set<String> localesFound = null;
     protected static Set<String> componentNamesFound = null;
     protected static Map<String, Map<String, Integer>> references = null;
+    protected static List<LabelInfo> duplicatedLocalesLabelsList = null;
     protected static int duplicatedLocalesLabels = 0;
 
     protected static GenericDelegator delegator;
@@ -97,6 +100,7 @@
         fileComponent = new TreeMap<String, String>();
         localesFound = new TreeSet<String>();
         componentNamesFound = new TreeSet<String>();
+        duplicatedLocalesLabelsList = FastList.newInstance();
         references = null;
         int duplicatedLocales = 0;
 
@@ -133,6 +137,7 @@
                                             labels.put(labelKey + keySeparator + fileName, label);
                                         } else {
                                             if (label.setLabelValue(localeName, labelValue, labelComment, false)) {
+                                                duplicatedLocalesLabelsList.add(label);
                                                 duplicatedLocales++;
                                             }
                                         }
@@ -251,6 +256,10 @@
         return duplicatedLocalesLabels;
     }
 
+    public static List<LabelInfo> getDuplicatedLocalesLabelsList() {
+        return duplicatedLocalesLabelsList;
+    }
+
     public static Map<String, Object> updateLabelKey(DispatchContext dctx, Map<String, ? extends Object> context) {
         String key = (String)context.get("key");
         String keyComment = (String)context.get("keyComment");

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/LabelManager.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/LabelManager.groovy?rev=750632&r1=750631&r2=750632&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/LabelManager.groovy (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/LabelManager.groovy Thu Mar  5 22:17:09 2009
@@ -29,4 +29,5 @@
 context.references = LabelManagerFactory.getReferences();
 context.referencesList = LabelManagerFactory.getReferencesList();
 context.duplicatedLocalesLabels = LabelManagerFactory.getDuplicatedLocalesLabels();
+context.duplicatedLocalesLabelsList = LabelManagerFactory.getDuplicatedLocalesLabelsList();
 context.keySeparator = LabelManagerFactory.keySeparator;

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/SearchLabels.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/SearchLabels.ftl?rev=750632&r1=750631&r2=750632&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/SearchLabels.ftl (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/SearchLabels.ftl Thu Mar  5 22:17:09 2009
@@ -88,6 +88,11 @@
           <#if (duplicatedLocalesLabels > 0)>
             <br/>
             <b>${uiLabelMap.WebtoolsLabelManagerWarningMessage} (${duplicatedLocalesLabels})</b>
+            <br/>
+            <#list duplicatedLocalesLabelsList as duplicatedLocalesLabel>
+                <br>${duplicatedLocalesLabel.labelKey}
+            </#list>
+            <br/><br/>${uiLabelMap.WebtoolsLabelManagerClearCacheAfterFixingDuplicateLabels}
           <#else>
             <input type="submit" name="searchLabels" value="${uiLabelMap.CommonFind}"/>
           </#if>