Make POP3 use password store too.
[claws.git] / po / merge-po-from-plugin.sh
1 #!/bin/bash
2 if [ "$1" = "" -o "$2" = "" ]; then
3         echo usage: $0 path/to/oldplugin/po/ ../src/plugins/newplugin
4         exit 1
5 fi
6
7 #Check if new files are in POTFILES
8
9 sources=`find $2 -name '*.[ch]'`
10 translatedfiles=`grep -rwl '_(' $sources`
11 for file in $translatedfiles; do
12         file=`echo $file|sed "s/^\.\.\///"`
13         inPOTFILESin=`grep $file POTFILES.in`
14         inPOTFILES=`grep $file POTFILES`
15         if [ "$inPOTFILESin" = "" ]; then
16                 echo "$file not in POTFILES.in, please add it"
17                 err=1
18         elif [ "$inPOTFILES" = "" ]; then
19                 echo "$file not in POTFILES, please autogen.sh"
20                 err=1
21         fi
22 done
23 if [ "$err" = "1" ]; then
24         exit 1
25 fi
26
27 #update all with new files
28 make update-po
29
30 #Merge with old plugin po files
31 for pluginpo in $1/*.po; do
32         corepo=`basename $pluginpo`
33         msgcat --use-first $corepo $pluginpo > $corepo.new && mv $corepo.new $corepo
34 done;