	
#!/bin/sh
PO_PATH=../files
po_files=`ls ${PO_PATH}/*.po`
find ./ -name "*.c" | xargs xgettext -k_  -o temp.po --from-code=UTF-8 --no-location --force-po 
sed 's/CHARSET/UTF-8/g'  temp.po > new.po
rm temp.po
if [ -z "${po_files}" ]; then
	mv new.po ${PO_PATH}/zh_CN.po

else
	for po_file in ${po_files}
	do	
		if [ -f "$po_file" ]; then
			msgmerge --update -N "${po_file}" new.po
			sed -i 's/^#~ //' ${po_file}
			rm ${po_file}~ -f
		fi
	done
fi
rm new.po
