#!/bin/sh

# Markus Neteler 2006

if [ $# -gt 0 ] ; then
 echo "Script to merge GRASS .po files into existing .po files"
 echo "for use in GRASS:"
 echo "1. store received .po files into your HOME (libs, mods, tcl or a subset)"
 echo "2. cd locale/po"
 echo "3. po_merge.sh  # the script will ask you for the country code (de, lv, ja, ...)"
 echo "The script will take the .po file(s) from HOME and merge them into the existing files"
 exit 1
fi

echo -n "Language (de, lv, ja, pt_br, ...)?: "
read MYLANG

echo "grasstcl_${MYLANG}.po"
msgmerge ~/grasstcl_${MYLANG}.po grasstcl_${MYLANG}.po -o grasstcl_${MYLANG}.po2 &&  mv grasstcl_${MYLANG}.po2 grasstcl_${MYLANG}.po
echo "grassmods_${MYLANG}.po"
msgmerge ~/grassmods_${MYLANG}.po grassmods_${MYLANG}.po -o grassmods_${MYLANG}.po2 &&  mv grassmods_${MYLANG}.po2 grassmods_${MYLANG}.po
echo "grasslibs_${MYLANG}.po"
msgmerge ~/grasslibs_${MYLANG}.po grasslibs_${MYLANG}.po -o grasslibs_${MYLANG}.po2 &&  mv grasslibs_${MYLANG}.po2 grasslibs_${MYLANG}.po
  
