Check-in [788b0e7a60]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:788b0e7a603f291a07c6ac57bfb3df3c8d9ba32a
Date: 2012-05-07 11:07:55
User: BarryK
Comment:L18L: cdburner-wizard internationalised, plus incremental improvement

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/sbin/cdburner-wizard

@@ -4,102 +4,108 @@
 #Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html). 2007 www.puppylinux.com
 #updated for v1.0.5
 #updated for 2.17
 #v431 man, this script is ancient! have done some fixing.
 #120323 partial replace 'xmessage' with 'pupmessage'.
+#120507 L18L: internationalised. exit if SELECTIONS="" avoids "Usage of Xdialog"; gettext´ed
+
+. gettext.sh
+export TEXTDOMAIN=cdburner-wizard
 
 DRIVESFND="`probedisk2`"
 OPTICALDRVSFND="`echo "$DRIVESFND" | grep '|optical|'`"
 
 SELECTIONS="`echo "$OPTICALDRVSFND" | cut -f 1,3 -d "|" | tr " " "_" | tr "|" " " | tr '$' "_"`"
-
-CDROMDEV='nothing'
-CDROMLINK='nothing'
+if [ -z "$SELECTIONS" ]; then #120507
+ pupmessage -bg "red" -center -name "burnwiz" -title "$(gettext 'CD/DVD driver Wizard: FAILURE')" "$(gettext 'no optical drive found')"
+ exit 0
+fi
+
+nothing="$(gettext 'nothing')"
+CDROMDEV=$nothing
+CDROMLINK=$nothing
 if [ -e /dev/cdrom ];then
  CDROMDEV="/dev/`readlink /dev/cdrom | sed -e 's%/dev/%%'`"
  CDROMLINK="`readlink /dev/cdrom`"
 fi
 
-DVDDEV='nothing'
-DVDLINK='nothing'
+DVDDEV=$nothing
+DVDLINK=$nothing
 if [ -e /dev/dvd ];then
  DVDDEV="/dev/`readlink /dev/dvd | sed -e 's%/dev/%%'`"
  DVDLINK="`readlink /dev/dvd`"
 fi
 
-MSG1="Welcome to my CD and DVD Drive Wizard!"
+MSG1="$(gettext 'Welcome to my CD and DVD Drive Wizard!')"
 BGCOLOR1="#ffc0c0"
+
+CHOSECD="$(gettext 'Choose_cdrom')"
+CHOSEDVD="$(gettext 'Choose_dvd')"
 
 while :; do
 
-xmessage -bg "$BGCOLOR1" -center -name "burnwiz" -title "Optical Drive Wizard" -buttons \
- Choose_cdrom:11,Choose_dvd:20,HELP:15,EXIT:13 \
+xmessage -bg "$BGCOLOR1" -center -name "burnwiz" -title "$(gettext 'Optical Drive Wizard')" -buttons \
+ "${CHOSECD}":11,"${CHOSEDVD}":20,"$(gettext 'HELP')":15,"$(gettext 'EXIT')":13 \
  -file -<<FILETXT
+
 $MSG1
-Puppy has probed your PC and found these CD/DVD drives:
+$(gettext 'Puppy has probed your PC and found these CD/DVD drives:')
 $SELECTIONS
 
-Puppy thinks the default CDROM drive is:    $CDROMDEV
-Puppy thinks the default DVD drive is:      $DVDDEV
+`eval_gettext 'Puppy thinks the default CDROM drive is:     ${CDROMDEV}'`
+`eval_gettext 'Puppy thinks the default DVD drive is:       ${DVDDEV}'`
 
 DEVICE LINKS:
-/dev/cdrom is currently linked to: $CDROMLINK.
-/dev/dvd is currently linked to:   $DVDLINK.
+`eval_gettext '/dev/cdrom is currently linked to:  ${CDROMLINK}.'`
+`eval_gettext '/dev/dvd is currently linked to:    ${DVDLINK}.'`
 
-If you disagree with these choices, click the "Choose_cdrom"
-or "Choose_dvd" to change the selection.
+`eval_gettext 'If you disagree with these choices, click the "${CHOSECD}"
+or "${CHOSEDVD}" button to change the selection.'`
 FILETXT
 
 XREPLY=$?
 
-
 if [ $XREPLY -eq 11 ];then #choose cdrom
  BGCOLOR1="#c0e0ff"
   #v1.0.0
-  CDROMD0="`Xdialog --wmclass "burnwiz" --title "CD/DVD drive Wizard" --stdout --menubox "Choose which is the CDROM drive:" 0 48 4 $SELECTIONS 2> /dev/null `"
+  CDROMD0="`Xdialog --wmclass "burnwiz" --title "$(gettext 'CD/DVD drive Wizard')" --stdout --menubox "$(gettext 'Choose which is the CDROM drive:')" 0 48 4 $SELECTIONS 2> /dev/null `"
  if [ ! $? -eq 0 ];then
-  MSG1="YOU MADE NO CHOICE FOR CDROM DRIVE, KEEPING $CDROMDEV"
+  MSG1="`eval_gettext 'YOU MADE NO CHOICE FOR CDROM DRIVE, KEEPING ${CDROMDEV}'`"
  else
-   MSG1="YOU JUST CHOSE $CDROMD0 AS THE CDROM DRIVE"
+   MSG1="`eval_gettext 'YOU JUST CHOSE ${CDROMD0} AS THE CDROM DRIVE'`"
    CDROMDEV="$CDROMD0"
    CDROMLINK="$CDROMD0"
    #strip off the leading "/dev/"...
    echo -n $CDROMLINK | cut -f 3 -d '/' > /etc/cdromdevice
    rm -f /dev/cdrom
    ln -s $CDROMLINK /dev/cdrom
  fi
 fi
-
 if [ $XREPLY -eq 20 ];then #choose dvd
  BGCOLOR1="#c0e0ff"
  #v1.0.0
- DVDD0="`Xdialog --wmclass "burnwiz" --title "CD/DVD drive Wizard" --stdout --menubox "Choose which is the DVD drive:" 0 48 4 $SELECTIONS 2> /dev/null `"
+ DVDD0="`Xdialog --wmclass "burnwiz" --title "$(gettext 'CD/DVD drive Wizard')" --stdout --menubox "$(gettext 'Choose which is the DVD drive:')" 0 48 4 $SELECTIONS 2> /dev/null `"
  if [ ! $? -eq 0 ];then
-  MSG1="YOU MADE NO CHOICE FOR DVD DRIVE, KEEPING $DVDDEV"
+  MSG1="`eval_gettext 'YOU MADE NO CHOICE FOR DVD DRIVE, KEEPING ${DVDDEV}'`"
  else
-  MSG1="YOU JUST CHOSE $DVDD0 AS THE DVD DRIVE"
+  MSG1="`eval_gettext 'YOU JUST CHOSE ${DVDD0} AS THE DVD DRIVE'`"
   DVDDEV="$DVDD0"
   DVDLINK="$DVDD0"
    #strip off the leading "/dev/"...
    echo -n $DVDLINK | cut -f 3 -d '/' > /etc/dvddevice
    rm -f /dev/dvd
    ln -s $DVDLINK /dev/dvd
  fi
 fi
 
-
 if [ $XREPLY -eq 15 ];then #help
- pupmessage -bg "purple" -center -name "burnwiz" -title "CD/DVD driver Wizard: HELP" "/dev/dvd and /dev/cdrom are links to the actual devices, for example, a link
-to /dev/sdc. These should point to the drives that you want to read from.
-For example, my PC has two drives, a DVD read-only drive and a CD-burner
-drive. I point *both* /dev/dvd and /dev/cdrom to the DVD drive, although I
-could have pointed /dev/cdrom to the burner drive (a DVD drive can also read
-CDs, so I chose it as my default for reading both CDs and DVDs).
+ pupmessage -bg "SkyBlue" -center  -title "$(gettext 'CD/DVD driver Wizard: HELP')" "$(gettext '/dev/dvd and /dev/cdrom are links to the actual devices, for example, a link to /dev/sdc. These should point to the drives that you want to read from.
+For example, my PC has two drives, a DVD read-only drive and a CD-burner drive.
+I point *both* /dev/dvd and /dev/cdrom to the DVD drive, although I could have pointed /dev/cdrom to the burner drive (a DVD drive can also read CDs, so I chose it as my default for reading both CDs and DVDs).
 
-There are various applications for reading from CD or DVD. For example, Gxine
-can play audio CDs and video DVDs. Most of these applications require that
-/dev/cdrom or /dev/dvd point to the correct devices."
+There are various applications for reading from CD or DVD. For example, Gxine can play audio CDs and video DVDs. Some of these applications require that /dev/cdrom
+or /dev/dvd point to the correct devices.')"
 fi
 
 if [ $XREPLY -eq 13 ];then #exit
  break
 fi