tazusb rev 57

Gettextize tazusbbox
author Christophe Lincoln <pankso@slitaz.org>
date Fri Feb 19 21:31:14 2010 +0100 (2010-02-19)
parents 1f8492c1765b
children 2e5ac32b52ee
files tazusbbox
line diff
     1.1 --- a/tazusbbox	Fri Feb 12 23:24:05 2010 +0100
     1.2 +++ b/tazusbbox	Fri Feb 19 21:31:14 2010 +0100
     1.3 @@ -2,7 +2,7 @@
     1.4  #
     1.5  # Tiny GTKdialog interface to SliTaz Live USB tool aka TazUSB.
     1.6  #
     1.7 -# (c) 2009 SliTaz GNU/Linux - GNU gpl v3
     1.8 +# (c) 2010 SliTaz GNU/Linux - GNU gpl v3
     1.9  #
    1.10  
    1.11  # TazUSBbox is only for root.
    1.12 @@ -11,24 +11,15 @@
    1.13  	exit 0
    1.14  fi
    1.15  
    1.16 -# Languages messages translations
    1.17 +# Include gettext helper script.
    1.18 +. /usr/bin/gettext.sh
    1.19  
    1.20 -case $LANG in
    1.21 -	fr*)
    1.22 -		MAIN_MSG="
    1.23 -Générer un LiveUSB de SliTaz et démarrer! Insérer un LiveCD dans
    1.24 -le lecteur de cdrom, séléctionner le media et appuyer sur générer.
    1.25 -"
    1.26 -		GENERATE_BUTTON="Générer"
    1.27 -		EXIT_BUTTON="Quitter" ;;
    1.28 -	*)
    1.29 -		MAIN_MSG="
    1.30 -Generate SliTaz LiveUSB media and boot in RAM! Insert a LiveCD into
    1.31 -the cdrom drive, select the correct device and press Generate.
    1.32 -"
    1.33 -		GENERATE_BUTTON="Generate"
    1.34 -		EXIT_BUTTON="Exit" ;;
    1.35 -esac
    1.36 +# Export package name for gettext.
    1.37 +TEXTDOMAIN='tazusbbox'
    1.38 +export TEXTDOMAIN
    1.39 +
    1.40 +# $BIN for functions.
    1.41 +export BIN=$0
    1.42  
    1.43  # Functions
    1.44  
    1.45 @@ -48,36 +39,38 @@
    1.46  
    1.47  box()
    1.48  {
    1.49 -	MAIN_DIALOG="
    1.50 -<window title=\"TazUSB Box\" icon-name=\"media-flash\">
    1.51 +	MAIN_DIALOG='
    1.52 +<window title="'`gettext "TazUSB Box"`'" icon-name="media-flash">
    1.53  <vbox>
    1.54  	
    1.55 -	<text width-chars=\"60\">
    1.56 -		<label>\"$MAIN_MSG\"</label>
    1.57 +	<text width-chars="60">
    1.58 +		<label>"'`gettext "
    1.59 +Generate SliTaz LiveUSB media and boot in RAM! Insert a LiveCD into
    1.60 +the cdrom drive, select the correct device and press Generate.
    1.61 +"`'"</label>
    1.62  	</text>
    1.63  
    1.64 -	<frame ISO to USB (Optional default is CDROM)>
    1.65 +	<frame '`gettext "ISO to USB (Optional default is CDROM)"`'>
    1.66  		<hbox>
    1.67 -			<text use-markup=\"true\">
    1.68 -				<label>\"<b>ISO image:</b>\"</label>
    1.69 +			<text use-markup="true">
    1.70 +				<label>"'`gettext "<b>ISO image:</b>"`'"</label>
    1.71  			</text>
    1.72 -			<entry accept=\"filename\">
    1.73 -				<label>Select an ISO image</label>
    1.74 +			<entry accept="filename">
    1.75  				<variable>ISO_IMAGE</variable>
    1.76  			</entry>
    1.77  			<button>
    1.78 -				<input file stock=\"gtk-open\"></input>
    1.79 -				<action type=\"fileselect\">ISO_IMAGE</action>
    1.80 +				<input file icon="tazlito"></input>
    1.81 +				<action type="fileselect">ISO_IMAGE</action>
    1.82  			</button>
    1.83  		</hbox>
    1.84  	</frame>
    1.85  	
    1.86  	<hbox>
    1.87 -		<text use-markup=\"true\">
    1.88 -			<label>\"<b>USB Media:</b>\"</label>
    1.89 +		<text use-markup="true">
    1.90 +			<label>"'`gettext "<b>USB Media:</b>"`'"</label>
    1.91  		</text>
    1.92  		<combobox>
    1.93 -			<variable>DEVICE</variable>"
    1.94 +			<variable>DEVICE</variable>'
    1.95  			if [ -d /proc/scsi/usb-storage ]; then
    1.96  				MAIN_DIALOG=${MAIN_DIALOG}"
    1.97  				<item></item>"
    1.98 @@ -86,28 +79,28 @@
    1.99  					<item>$i</item>"
   1.100  				done
   1.101  			else
   1.102 -				MAIN_DIALOG=${MAIN_DIALOG}"
   1.103 -				<item>Not found</item>"
   1.104 +				MAIN_DIALOG=${MAIN_DIALOG}'
   1.105 +				<item>'`gettext "Not found"`'</item>'
   1.106  			fi
   1.107 -			export MAIN_DIALOG=${MAIN_DIALOG}"
   1.108 +			export MAIN_DIALOG=${MAIN_DIALOG}'
   1.109  		</combobox>
   1.110  	</hbox>
   1.111  	<hbox>
   1.112  		<button>
   1.113 -			<label>$GENERATE_BUTTON</label>
   1.114 -			<input file icon=\"forward\"></input>	
   1.115 -			<action>$0 gen_live</action>
   1.116 +			<label>'`gettext "Generate"`'</label>
   1.117 +			<input file icon="forward"></input>	
   1.118 +			<action>$BIN gen_live</action>
   1.119  			<action>clear:ISO_IMAGE</action>
   1.120  		</button>
   1.121  		<button>
   1.122 -			<label>$EXIT_BUTTON</label>
   1.123 -			<input file icon=\"exit\"></input>
   1.124 -			<action type=\"exit\">exit</action>
   1.125 +			<label>'`gettext "Exit"`'</label>
   1.126 +			<input file icon="exit"></input>
   1.127 +			<action type="exit">exit</action>
   1.128  		</button>
   1.129  	</hbox>
   1.130  	
   1.131  </vbox>
   1.132 -</window>"
   1.133 +</window>'
   1.134  	gtkdialog --center --program=MAIN_DIALOG #>/dev/null
   1.135  }
   1.136