Skip to content

Commit

Permalink
Display messages in correct language if LANG=C
Browse files Browse the repository at this point in the history
  • Loading branch information
mavrothal committed Oct 15, 2015
1 parent bac8a33 commit 52c451b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions woof-code/rootfs-skeleton/usr/local/petget/installpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ if [ "`grep "$PTN1" /root/.packages/user-installed-packages`" != "" ];then
DISPTIME2="-timeout 3"
fi
if [ ! $DISPLAY ];then
dialog ${DISPTIME1} --msgbox "$(gettext 'Sorry, this package is already installed. Aborting.')" 0 0
LANG=$LANG_USER
. dialog ${DISPTIME1} --msgbox "$(gettext 'Sorry, this package is already installed. Aborting.')" 0 0
else
LANG=$LANG_USER
. pupmessage -bg '#ff8080' -fg black ${DISPTIME2} -title "$(gettext 'Package:') ${DLPKG_NAME}" "$(gettext 'Sorry, but this package is already installed. Cannot install it twice.')"
echo ${DLPKG_NAME} >> /tmp/pgks_failed_to_install_forced
fi
Expand Down Expand Up @@ -165,6 +167,7 @@ fi
#as the pkg gets expanded to an intermediate dir, maybe in main f.s...
PARTK=`df -k / | grep '/$' | tr -s ' ' | cut -f 4 -d ' '` #free space in partition.
if [ $NEEDK -gt $PARTK ];then
LANG=$LANG_USER
ABORTMSG1="$(gettext 'Package:') ${DLPKG_BASE}"
ABORTMSG2="$(gettext 'Sorry, there is not enough free space in the partition to install this package')"
if [ $DISPLAY ];then
Expand Down Expand Up @@ -201,6 +204,7 @@ elif [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then
fi

if [ $DISPLAY -a ! -f /tmp/install_quietly ];then #131222
LANG=$LANG_USER
. /usr/lib/gtkdialog/box_splash -close never -fontsize large -text "$(gettext 'Please wait, processing...')" &
YAFPID1=$!
trap 'pupkill $YAFPID1' EXIT #140318
Expand All @@ -227,10 +231,11 @@ case $DLPKG_BASE in
[ "$PETFOLDER" = "" ] && PETFOLDER=$(echo "${PETFILES}" | cut -f 1 -d '/' | head -n 1)
if [ "${DLPKG_MAIN}" != "${PETFOLDER}" ]; then
pupkill $YAFPID1
LANG=$LANG_USER
if [ "$DISPLAY" ]; then
/usr/lib/gtkdialog/box_ok "$(gettext 'Puppy Package Manager')" error "<b>${DLPKG_MAIN}.pet</b> $(gettext 'is named') <b>${PETFOLDER}</b> $(gettext 'inside the pet file. Will not install it!')"
. /usr/lib/gtkdialog/box_ok "$(gettext 'Puppy Package Manager')" error "<b>${DLPKG_MAIN}.pet</b> $(gettext 'is named') <b>${PETFOLDER}</b> $(gettext 'inside the pet file. Will not install it!')"
else
dialog --msgbox "$DLPKG_MAIN.pet $(gettext 'is named') $PETFOLDER $(gettext 'inside the pet file. Will not install it!')" 0 0
. dialog --msgbox "$DLPKG_MAIN.pet $(gettext 'is named') $PETFOLDER $(gettext 'inside the pet file. Will not install it!')" 0 0
fi
exit 1
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

export TEXTDOMAIN=petget___removepreview.sh
export OUTPUT_CHARSET=UTF-8

[ "$(locale | grep '^LANG=' | cut -d '=' -f 2)" ] && ORIGLANG="$(locale | grep '^LANG=' | cut -d '=' -f 2)"
. /etc/rc.d/PUPSTATE #111228 this has PUPMODE and SAVE_LAYER.
. /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION
. /root/.packages/DISTRO_PKGS_SPECS
Expand Down

0 comments on commit 52c451b

Please sign in to comment.