Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / scripts / i18n / Merge2PropertiesFile.groovy @ 1000

History | View | Annotate | Download (783 Bytes)

1
package org.txm.scripts.scripts.i18n
2

    
3
File propFile1 = new File("/home/mdecorde/workspace43/org.eclipse.equinox.p2.ui.nl_fr/org/eclipse/equinox/internal/p2/ui/messages_fr.properties")
4
File propFile2 = new File("/home/mdecorde/workspace43/org.txm.rcp.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages_fr.properties")
5

    
6
Properties props1 = new Properties()
7
props1.load(propFile1.newReader("iso-8859-1"))
8
Properties props2 = new Properties()
9
props2.load(propFile2.newReader("iso-8859-1"))
10

    
11
println "props1.size = "+props1.size()
12
println "props2.size = "+props2.size()
13

    
14
for( def key : props1.keySet()) {
15
        println "update: "+key
16
        props2.put(key, props1.get(key))
17
}
18

    
19
println "props2.size AFTER = "+props2.size()
20
props2.store(propFile2.newWriter("iso-8859-1"), "$propFile1 + $propFile2")