JAL-1424 also report (obsolete) keys in translated bundle not in default
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 24 Aug 2016 09:34:04 +0000 (10:34 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 24 Aug 2016 09:34:04 +0000 (10:34 +0100)
utils/i18nAnt.xml

index 47c404e..01973d2 100755 (executable)
@@ -19,8 +19,7 @@
         var logger = project.getBuildListeners( ).firstElement( );
         logger.setMessageOutputLevel( 1 );
     </script>
-       <echo message="Missing message labels compared to Messages.properties"/>
-       <foreach target="compareProperties" param="file2">
+       <foreach target="compareBundles" param="file2">
                <path>
                        <fileset dir="${basedir}/resources/lang">
                                <exclude name="Messages.properties" />
        </foreach>
 </target>
 
+<target name="compareBundles" description="compare a properties file with Messages.properties and vice versa">
+       <echo message=" "/>
+       <echo message="Missing message labels in ${file2} compared to Messages.properties"/>
+       <antcall target="compareProperties">
+               <param name="file1" value="resources/lang/Messages.properties"/>
+               <param name="file2" value="${file2}" />
+       </antcall>
+       <echo message=" "/>
+       <echo message="Missing message labels in Messages.properties compare to ${file2}"/>
+       <antcall target="compareProperties">
+               <param name="file2" value="resources/lang/Messages.properties"/>
+               <param name="file1" value="${file2}" />
+       </antcall>
+</target>
+               
 <target name="compareProperties" description="reports missing entries in one message bundle">
-    <loadproperties srcFile="resources/lang/Messages.properties" prefix="prefixfile1"/>
+    <loadproperties srcFile="${file1}" prefix="prefixfile1"/>
     <loadproperties srcFile="${file2}" prefix="prefixfile2"/>
 
     <propertyselector property="file1.list" delimiter="," match="prefixfile1\.(.+)" select="\1"/>
     <propertyselector property="file2.list" delimiter="," match="prefixfile2\.(.+)" select="\1"/>
        
-       <echo message=" "/>
-       <echo message="*** ${file2}:" />
     <for list="${file1.list}" param="file1.property">
         <sequential>
             <if>