#! /bin/bash APPLY=false if [ "$1" = --apply ]; then APPLY=: shift fi KEEP_OLD=false if [ "$1" = --keep-old ]; then KEEP_OLD=: shift fi PREFIX= if [ "$1" = --prefix ]; then PREFIX="$2-" shift 2 fi SOURCE="$1" shift MY_LANG="$1" case $MY_LANG in pa_IN) ROSETTA_LANG=pa ;; *) ROSETTA_LANG="$MY_LANG" ;; esac [ -e $SOURCE/$PREFIX$ROSETTA_LANG.po ] || exit msgmerge -q -N <(msgconv -t UTF-8 $SOURCE/$PREFIX$ROSETTA_LANG.po | msgattrib --no-obsolete -) *.pot | msgattrib --no-obsolete $MSGATTRIB_OPTS - | \ if [ -e $MY_LANG.po ]; then if $KEEP_OLD; then msgmerge -q -N <(msgconv -t UTF-8 $MY_LANG.po | msgattrib --no-obsolete -) *.pot -C - else msgmerge -q -N - <(msgconv -t UTF-8 $MY_LANG.po | msgattrib --no-obsolete -) fi | \ msgattrib --no-obsolete - else cat fi | \ if $APPLY; then sponge $MY_LANG.po else diff -u --label $MY_LANG.po <(msgconv -t UTF-8 $MY_LANG.po) - fi