X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fupdate-locale;h=033ba84a3fcbb35167e3731820ff4aec61e171e7;hb=e228f3c3cda1a0093f7bf5ac3dc3b465732d23b7;hp=e93a247064e584c0ae48f877d5779f88cdbe8487;hpb=6477785e7e3979f759f0dfa85dad189c6ce1e55a;p=gosa.git diff --git a/gosa-core/update-locale b/gosa-core/update-locale index e93a24706..033ba84a3 100755 --- a/gosa-core/update-locale +++ b/gosa-core/update-locale @@ -38,7 +38,19 @@ generate_po() { for f in locale/${l_path}??/LC_MESSAGES; do [[ "$f" == "locale/${l_path}??/LC_MESSAGES" ]] && break echo -n "* merging $f/messages.po: " - [ -f $f/messages.po ] && msgmerge $f/messages.po locale/${l_path}messages.po --output-file=$f/messages.po.new &> /dev/null + [ ! -f $f/messages.po ] && touch $f/messages.po + + # If we're in a plugin of a trunk checkout, we can use the gosa-all messages.po as a dictionary + DICT_FILE_ALL="$ORIG/../../gosa-all/gosa/${f/locale/locale/core}/messages.po" + DICT_FILE_CORE="$ORIG/../../gosa-core/${f/locale/locale/core}/messages.po" + DICT="" + [ -r $DICT_FILE_ALL ] && DICT="-C $DICT_FILE_ALL" + [ ${#DICT} -eq 0 ] && [ -r $DICT_FILE_CORE ] && DICT="-C $DICT_FILE_CORE" + msgmerge $DICT $f/messages.po locale/${l_path}messages.po --output-file=$f/messages.po.tmp &> /dev/null + + # Filter out duplicates + msguniq $f/messages.po.tmp --output-file=$f/messages.po.new &> /dev/null + rm $f/messages.po.tmp # Do an extra check for dummy dir 'locale/en/LC_MESSAGES' if [ $? -ne 0 ]; then @@ -123,8 +135,7 @@ do y) ASSUME_Y=1; ;; h|--help) - echo "Usage: $(basename $0) [-g] [-y] method" - echo " method can be 'core' or 'plugin'" + echo "Usage: $(basename $0) [-g] [-y]" echo " -g extract strings from GOsa and generate po files" echo " -y assume yes" exit 1 @@ -133,12 +144,8 @@ do done shift $(($OPTIND - 1)) -# Check method -if [ "$1" != "plugin" -a "$1" != "core" ]; then - echo "Need explicit method 'core' or 'plugin' to create locale." - exit 1 -fi -if [ "$1" == "plugin" ]; then +# If there's a plugin.dsc in ., then assume "plugin" +if [ -f plugin.dsc ]; then l_path="" else l_path="core/"