Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| SHA1 Hash: | 40efc714d43322c5bfceee731a3b55f34b31f815 |
|---|---|
| Date: | 2012-01-31 00:58:39 |
| User: | BarryK |
| Comment: | rodin.s: internationalized pgprs scripts, clean_desk_icons, pup_event_frontend_d, pupdialog, xwin |
Tags And Properties
- branch=trunk inherited from [7b0fdb6f2f]
- sym-trunk inherited from [7b0fdb6f2f]
Changes
Changes to woof-code/kernel-skeleton/lib/modules/all-firmware/pgprs/usr/bin/pgprs-connect
@@ -1,13 +1,18 @@ #!/bin/sh +#120131 rodin.s: internationalized. + +export TEXTDOMAIN=pgprs-connect +export OUTPUT_CHARSET=UTF-8 + n="r" while [ "$n" = "r" ] do /usr/sbin/pppd call gprsmm n="q" echo "Exit status is $?" -echo "DISCONNECTED" +echo "$(gettext 'DISCONNECTED')" echo "" -echo "Press ENTER to quit" -echo "Press r ENTER to reconnect/try again" +echo "$(gettext 'Press ENTER to quit')" +echo "$(gettext 'Press r ENTER to reconnect/try again')" read n done
Changes to woof-code/kernel-skeleton/lib/modules/all-firmware/pgprs/usr/bin/pgprs-setup
@@ -2,10 +2,15 @@
# PGPRS SETUP: Puppy Generic GPRS Modem Setup Utility
#(c) Copyright Aug. 2008 Lloyd Standish www.voluntary-simplicity.org/linux
#2007 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
# version 1.3 Aug. 16, 2008
#101204 Dejan: if there's no pin gtkdialog has errors, put 1234 instead blank.
+#120131 rodin.s: i18n
+
+export TEXTDOMAIN=pgprs-setup
+export OUTPUT_CHARSET=UTF-8
+. gettext.sh
function wordreplace() {
#argument 1: file to search
#argument 2: search phrase
@@ -34,11 +39,11 @@
# phone: /etc/ppp/peers/gprs-connect-chatmm
# APN /etc/ppp/peers/gprs-connect-chatmm
# PIN /etc/ppp/peers/gprs-connect-chatmm
if [ ! -f "/etc/ppp/peers/gprsmm" -o ! -f "/etc/ppp/peers/gprs-connect-chatmm" ]; then
- xmessage -bg "#ff8080" -center -title "PGPRS SETUP" "ERROR: one or more PGPRS files missing. Please reinstall package"
+ xmessage -bg "#ff8080" -center -title "$(gettext 'PGPRS SETUP')" "$(gettext 'ERROR: one or more PGPRS files missing. Please reinstall package')"
fi
USER=$"`grep "^user" /etc/ppp/peers/gprsmm | sed 's/\(^user[ ]*\"\)\([^\"]*\)\(.*\)/\2/'`"
OLDUSER="$USER"
if [ "$USER" = "" ]; then
USER=gprsuser
@@ -79,22 +84,21 @@
# -a "`echo ATZ > "$DEVICE"`" = ""
DETECTED="$DETECTED $DEVICE"
fi
done
if [ "$DETECTED" = "" ]; then
- DETECTED="No devices detected. If USB, plug device and click 'RE-PROBE MODEMS'"
+ DETECTED="`gettext \"No devices detected. If USB, plug device and click 'RE-PROBE MODEMS'\"`"
else
- DETECTED="detected devices: $DETECTED"
+ DETECTED="$(gettext 'detected devices:') $DETECTED"
fi
export MAIN_DIALOG="
<vbox>
-<text use-markup=\"true\"> <label>\"<b>PGPRS MODEM SETUP</b>\"</label></text>
-<text><label>
-If your GPRS ISP does not require a username/password, you should leave the defaults. If you do not know your ISP's APN or the phone number to dial for connection, you can exit and run this setup program again later (click the 'connect' icon on the desktop) The default APN, \"icecelular\", is correct only for Costa Rica.</label></text>
+<text use-markup=\"true\"> <label>\"<b>$(gettext 'PGPRS MODEM SETUP')</b>\"</label></text>
+<text><label>$(gettext \"If your GPRS ISP does not require a username/password, you should leave the defaults. If you do not know your ISP's APN or the phone number to dial for connection, you can exit and run this setup program again later (click the 'connect' icon on the desktop) The default APN, 'icecelular', is correct only for Costa Rica.\")</label></text>
<hbox>
<text>
- <label>Serial Modem Device File:</label>
+ <label>$(gettext 'Serial Modem Device File:')</label>
</text>
<entry>
<default>${DEV}</default>
<variable>DEV</variable>
</entry>
@@ -112,41 +116,41 @@
</entry>
</hbox>
<hbox>
<text>
- <label>Username:</label>
+ <label>$(gettext 'Username:')</label>
</text>
<entry>
<default>${USER}</default>
<variable>USER</variable>
</entry>
</hbox>
<hbox>
<text>
- <label>Password:</label>
+ <label>$(gettext 'Password:')</label>
</text>
<entry>
<default>${PASS}</default>
<variable>PASS</variable>
</entry>
</hbox>
<hbox>
<text>
- <label>Phone number:</label>
+ <label>$(gettext 'Phone number:')</label>
</text>
<entry>
<default>${PHONE}</default>
<variable>PHONE</variable>
</entry>
</hbox>
<hbox>
<text>
- <label>Phone PIN:</label>
+ <label>$(gettext 'Phone PIN:')</label>
</text>
<entry>
<default>${PIN}</default>
<variable>PIN</variable>
</entry>
@@ -154,21 +158,21 @@
<hbox>
<button ok></button>
<button cancel></button>
<button>
- <label>RE-PROBE MODEMS</label>
+ <label>$(gettext 'RE-PROBE MODEMS')</label>
</button>
</hbox>
</vbox>
"
I=$IFS; IFS=""
for STATEMENTS in $(gtkdialog3 --program=MAIN_DIALOG); do
eval $STATEMENTS
done
IFS=$I
-if [ "$EXIT" = "RE-PROBE MODEMS" ]; then
+if [ "$EXIT" = "$(gettext 'RE-PROBE MODEMS')" ]; then
continue
fi
if [ "$EXIT" = "OK" ]; then
LACK=""
if [ "$DEV" = "" -o "$DEV" = "/dev/yourdevice" ]; then
@@ -190,11 +194,11 @@
if [ "${APN}" = "" ]; then
LACK="$LACK APN"
APN="icecelular"
fi
if [ "$LACK" != "" ]; then
- xmessage -bg "#ff8080" -center -title "MT-GPRS SETUP" "The following must not be left blank: $LACK"
+ xmessage -bg "#ff8080" -center -title "$(gettext 'MT-GPRS SETUP')" "$(gettext 'The following must not be left blank:') $LACK"
continue
fi
wordreplace /etc/ppp/peers/gprsmm "user" "user \"$USER\"" 1
wordreplace /etc/ppp/peers/gprsmm "$RGDEV" "$DEV" 1
wordreplace /etc/ppp/pap-secrets "$OLDUSER * $OLDPASS" "$USER * $PASS" 1
@@ -201,9 +205,9 @@
chmod 600 /etc/ppp/pap-secrets
wordreplace /etc/ppp/peers/gprs-connect-chatmm "${RGPHONE}" "ATD${PHONE}"
wordreplace /etc/ppp/peers/gprs-connect-chatmm "$RGAPN" "AT+CGDCONT=1,\"IP\",\"$APN\""
wordreplace /etc/ppp/peers/gprs-connect-chatmm "$RGPIN" "AT+CPIN=\"$PIN\""
chmod 700 /etc/ppp/peers/gprs-connect-chatmm
- xmessage -center -title "PGPRS SETUP" "Connect to the Internet using 'PGPRS Connect' in the 'Network' menu."
+ xmessage -center -title "$(gettext 'PGPRS SETUP')" "$(gettext \"Connect to the Internet using 'PGPRS Connect' in the 'Network' menu.\")"
fi
break
done
Changes to woof-code/kernel-skeleton/lib/modules/all-firmware/pgprs/usr/share/applications/pgprs-connect.desktop
@@ -1,10 +1,11 @@ [Desktop Entry] Encoding=UTF-8 Name=PGPRS Connect +Name[ru]=PGPRS Подключить Icon=mini-connect.xpm Comment=Connect via GPRS modem Exec=rxvt -title "pgprs-connect PRESS CTRL+C TO DISCONNECT" -e pgprs-connect Terminal=false Type=Application Categories=Dialup GenericName=Connect via GPRS modem
Changes to woof-code/kernel-skeleton/lib/modules/all-firmware/pgprs/usr/share/applications/pgprs-setup.desktop
@@ -1,10 +1,11 @@ [Desktop Entry] Encoding=UTF-8 Name=PGPRS Setup +Name[ru]=PGPRS Настройка Icon=mini-connect.xpm Comment=Puppy GPRS Setup Exec=pgprs-setup Terminal=false Type=Application Categories=Dialup GenericName=Puppy GPRS Setup
Changes to woof-code/rootfs-skeleton/sbin/clean_desk_icons
@@ -1,10 +1,16 @@
#!/bin/sh
#BK called from /root/.xinitrc
#v410 remove icons when drives removed.
#v410 omit icon if optical drive; defer it to pup_event_frontend_d
#w014 bugfix, refresh icons if removable drive swapped when PC turned off.
+#120131 rodin.s: internationalized. See warning about "Size:" translation.
+
+# i18n gettext
+TEXTDOMAIN=clean_desk_icons
+export TEXTDOMAIN
+. /usr/bin/gettext.sh
export LANG=C
. /etc/eventmanager #has RAMSAVEINTERVAL, ICONDESK, ICONPARTITIONS, HOTPLUGNOISY, HOTPLUGON, FLOPPYICON.
ePUPPYPIN="`grep -v '/root/.pup_event/drive_' /root/Choices/ROX-Filer/PuppyPin | grep -v '</pinboard>'`"
@@ -50,11 +56,17 @@
if [ "$DRVCUT" = "hd" ];then
MEDIACAT="`cat /proc/ide/${ONEDRV}/media`"
[ "$MEDIACAT" = "cdrom" ] && continue #v410 omit icon if optical drive; defer it to pup_event_frontend_d
fi
#w014 user may have swapped removable drives while pc turned off...
- DRVMODEL1="`grep -o '<Summary>.*Size:' /root/.pup_event/drive_${ONEDRV}/AppInfo.xml | cut -f 2-20 -d ' ' | rev | cut -f 2-20 -d ' ' | rev`"
+
+ LANG="`cat /etc/profile|grep '^LANG='`"
+ eval $LANG
+ T_size="`gettext \"Size:\"`" #*WARNING* translation must be same as in /sbin/pup_event_frontend_d create_icon_func()
+ LANG=C
+
+ DRVMODEL1="`grep -o '<Summary>.*${T_Size:}' /root/.pup_event/drive_${ONEDRV}/AppInfo.xml | cut -f 2-20 -d ' ' | rev | cut -f 2-20 -d ' ' | rev`"
#note, this must be same as done in /sbin/probedisk2...
DRVMODEL2="`cat /sys/block/$ONEDRV/device/vendor | tr -s ' '``cat /sys/block/${ONEDRV}/device/model | tr -s ' '`"
if [ "$DRVMODEL1" != "$DRVMODEL2" ];then
rm -rf /root/.pup_event/drive_${ONEDRV}* 2>/dev/null
continue
Changes to woof-code/rootfs-skeleton/sbin/pup_event_frontend_d
@@ -29,12 +29,17 @@
#110509 rerwin: full install, use only 1 line of multiline df result, to prevent warnings.
#110513 support sudo for non-root user. /etc/sudoers specifies password not required.
#111012 forwarding to old yaf-splash not killable.
#111228 added removepreview.sh test (in /usr/local/petget) but probably test for "petget" is already enough.
#120129 karl godt: fix ZOMBIES, see http://murga-linux.com/puppy/viewtopic.php?t=71767&start=420. see also rc.shutdown, pmount, drive_all.
+#120131 rodin.s: internationalized. BK: note, rodin.s's script different from that in Woof, applied changes line-by-line.
[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110513
+
+export TEXTDOMAIN=pup_event_frontend_d
+export OUTPUT_CHARSET=UTF-8
+. gettext.sh
OLDLANG=$LANG #100613
export LANG=C #w004
#v408 when testing k2.6.21.7, no DEVTYPE, had to modify udev rules which causes udevd to
@@ -137,11 +142,11 @@
create_appinfo_func() { #needs INFO, DRV_CATEGORY, MOREITEMS, ONEDRVNAME
echo "<?xml version=\"1.0\"?>
<AppInfo>
<Summary>${INFO}</Summary>
<About>
- <Purpose>Drive icons are part of Puppy Event Manager, see System menu</Purpose>
+ <Purpose>`gettext \"Drive icons are part of Puppy Event Manager, see System menu\"`</Purpose>
<Authors>Barry Kauler LGPL 2008</Authors>
</About>
<AppMenu>
<Item option=\"pmount_${DRV_CATEGORY}\" icon=\"gtk-harddisk\"><Label>Run Pmount Puppy Drive Mounter</Label></Item><Item option=\"eventmanager\" icon=\"gtk-execute\"><Label>Run Desktop Drive Icon Manager</Label></Item>${MOREITEMS}
</AppMenu>
@@ -343,10 +348,11 @@
DRVINFO="`echo "$PROBEPART" | grep "$drvPATTERN" | cut -f 1,2,3 -d '|' | tr '\n' ' '`"
done
fi
fi
+ LANG=$OLDLANG #see restored to C below.
for ONEDRVINFO in $DRVINFO
do
ONEDRVNAME="`echo -n "$ONEDRVINFO" | cut -f 1 -d '|' | cut -f 3 -d '/'`"
FSTYPE="`echo -n "$ONEDRVINFO" | cut -f 2 -d '|'`"
SIZE=`echo -n "$ONEDRVINFO" | cut -f 3 -d '|'`
@@ -357,19 +363,19 @@
if [ -e /sys/block/${ONEDRVNAME} ];then
#device is an entire drive.
SIZE=`cat /sys/block/${ONEDRVNAME}/size`
SIZE=$(($SIZE/2)) #get KB.
format_size_func #formats SIZE for display.
- INFO="Description: ${DRV_DESCRIPTION} Size: ${SIZE}"
+ INFO="`eval_gettext \"Description: \\\${DRV_DESCRIPTION} Size: \\\${SIZE}\"`" #*WARNING* translate same "Size:" in clean_desk_icons !!!
else
if [ "$FSTYPE" = "0" -a "$SIZE" = "0" ];then
- INFO="Puppy drive manager"
+ INFO="`gettext \"Puppy drive manager\"`"
else
#pPATTERN=' '"$ONEDRVNAME"'$'
#SIZE=`grep "$pPATTERN" /proc/partitions | tr -s ' ' | cut -f 4 -d ' '`
format_size_func #formats SIZE for display.
- INFO="Filesystem: $FSTYPE Size: $SIZE"
+ INFO="`eval_gettext \"Filesystem: \\\${FSTYPE} Size: \\\${SIZE}\"`" #*WARNING* translate same "Size:" in clean_desk_icons !!!
fi
fi
#v424 add item to unmount all partitions...
MOREITEMS="<Item option=\"unmount\" icon=\"gtk-harddisk\"><Label>Unmount ${ONEDRVNAME} (if currently mounted)</Label></Item><Item option=\"unmountall\" icon=\"gtk-harddisk\"><Label>Unmount ALL mounted partitions</Label></Item>"
create_appinfo_func #needs INFO, DRV_CATEGORY, MOREITEMS, ONEDRVNAME
@@ -390,17 +396,18 @@
mkdir /root/.pup_event/drive_${DRV_NAME}
cp -af /usr/local/bin/drive_all /root/.pup_event/drive_${DRV_NAME}/AppRun
SIZE=`cat /sys/block/${DRV_NAME}/size`
SIZE=$(($SIZE/2)) #get KB.
format_size_func #formats SIZE for display.
- INFO="Description: ${DRV_DESCRIPTION} Size: ${SIZE}"
+ INFO="`eval_gettext \"Description: \\\${DRV_DESCRIPTION} Size: \\\${SIZE}\"`"
#v424 add item to unmount all mounted partitions...
- MOREITEMS="</Item><Item option=\"unmountall\" icon=\"gtk-harddisk\"><Label>Unmount ALL mounted partitions</Label></Item>"
+ MOREITEMS="</Item><Item option=\"unmountall\" icon=\"gtk-harddisk\"><Label>`gettext \"Unmount ALL mounted partitions\"`</Label></Item>"
ONEDRVNAME="$DRV_NAME"
create_appinfo_func #needs INFO, DRV_CATEGORY, MOREITEMS, ONEDRVNAME
fi
fi
+ LANG=C
}
remove_pinboard_func() { #needs DRV_NAME (name of entire drive)
ppPATTERN=' label="'"$DRV_NAME"'.*" '
[ "`grep "$ppPATTERN" /root/Choices/ROX-Filer/PuppyPin`" = "" ] && return
@@ -469,11 +476,13 @@
[ $PREVSIZEFREEM -eq $SIZEFREEM ] && return
if [ $SIZEFREEM -lt 10 ];then
if [ -d /initrd/pup_rw/lib/modules/all-firmware -a "$ZDRVINIT" = "yes" ];then
delete_func /initrd/pup_rw #save layer is at top, delete mods.
else
- WARNMSG="WARNING: Personal storage getting full, strongly recommend you resize it or delete files!"
+ LANG=$OLDLANG
+ WARNMSG="$(gettext 'WARNING: Personal storage getting full, strongly recommend you resize it or delete files!')"
+ LANG=C
fi
fi
VIRTUALFREEM=$SIZEFREEM
if [ "$ZDRVINIT" = "yes" ];then #full set of modules present, moved from initrd.
if [ -d /initrd/pup_rw/lib/modules/all-firmware ];then #have not yet deleted modules.
@@ -501,18 +510,22 @@
[ $PREVSIZEFREEM -eq $SIZEFREEM -a $PREVSIZETMPM -eq $SIZETMPM ] && return
if [ $SIZEFREEM -lt 10 ];then
if [ -d /initrd/pup_ro1/lib/modules/all-firmware -a "$ZDRVINIT" = "yes" ];then
delete_func /initrd/pup_ro1 #delete modules in save layer only.
else
- WARNMSG="WARNING: Personal storage file getting full, strongly recommend you resize it or delete files!"
+ LANG=$OLDLANG
+ WARNMSG="$(gettext 'WARNING: Personal storage file getting full, strongly recommend you resize it or delete files!')"
+ LANG=C
fi
fi
if [ $SIZETMPM -lt 5 ];then
if [ -d /initrd/pup_rw/lib/modules/all-firmware -a "$ZDRVINIT" = "yes" ];then
delete_func /initrd/pup_rw #delete modules in top tmpfs layer only.
else
- WARNMSG="WARNING: RAM working space only ${SIZETMPM}MB, recommend a reboot which will flush the RAM"
+ LANG=$OLDLANG
+ WARNMSG="$(gettext 'WARNING: RAM working space only') ${SIZETMPM}$(gettext 'MB, recommend a reboot which will flush the RAM')"
+ LANG=C
fi
fi
VIRTUALFREEM=$SIZEFREEM
if [ "$ZDRVINIT" = "yes" ];then #full set of modules present at bootup.
if [ -d /initrd/pup_ro1/lib/modules/all-firmware ];then #have not yet deleted modules.
@@ -533,11 +546,11 @@
savepuppy_func() { #called every 4 seconds.
if [ -f /tmp/snapmergepuppyrequest ];then #by request.
rm -f /tmp/snapmergepuppyrequest
#yaf-splash -font "8x16" -outline 0 -margin 4 -bg orange -placement top -text "Saving RAM to 'pup_save' file..." &
- yaf-splash -bg orange -placement top -close never -text "Saving RAM to 'pup_save' file..." &
+ yaf-splash -bg orange -placement top -close never -text "$(gettext "Saving RAM to 'pup_save' file...")" &
YAFPID=$!
sync
nice -n 19 /usr/sbin/snapmergepuppy
kill $YAFPID
fi
Changes to woof-code/rootfs-skeleton/usr/bin/pupdialog
@@ -3,10 +3,13 @@
#2011 GPL licence v3 (/usr/share/doc/legal)
#a simple replacement for 'dialog', for when X is running. can use this instead of Xdialog.
#110924 when no window decoration, also do not appear in taskbar. menu dlg to fit in 480 pixel screen vert. fix pupkill.
#111011 add --checklist dialog, --helpwindow parameter.
#111021 increase limit, number commandline items.
+#120131 rodin.s: adding gettext to help
+
+export TEXTDOMAIN=pupdialog
#examples passed params:
# --timeout 90 --extra-button --ok-label "SAVE TO A FILE" --extra-label "SAVE TO ${xPDEV}" --cancel-label "DO NOT SAVE" --yesno "etetetete" 0 0
#accept these, not available in dialog: --background --foreground --countdown "text"
@@ -171,11 +174,11 @@
TITLEPARAMS="decorated=\"false\" skip_taskbar_hint=\"true\""
fi
[ "$BACKTITLE" ] && BTTEXT="<text use-markup=\"true\"><label>\"<big><b>${BACKTITLE}</b></big>\"</label></text>"
if [ "$HELPWINDOW" ];then
- HELPBUTTONXML="<button><label>Help</label><action>${HELPWINDOW} & </action></button>"
+ HELPBUTTONXML="<button><label>$(gettext 'Help')</label><action>${HELPWINDOW} & </action></button>"
fi
export PUP${$}DLG="<window ${TITLEPARAMS}>
<vbox>
${BTTEXT}
Changes to woof-code/rootfs-skeleton/usr/bin/xwin
@@ -25,10 +25,19 @@
#110413 variable DISTRO_XORG_AUTO in /etc/DISTRO_SPECS, set in Woof '3builddistro'.
#110622 fix handling of DISTRO_XORG_AUTO.
#110721 o/p to /dev/null when modprobe modules that are builtin to kernel.
#110804 /etc/profile has fix for double-login. need to output '# ' when exit xwin.
#110807 revert 110804
+#120131 rodin.s: internationalized.
+
+export TEXTDOMAIN=xwin
+export OUTPUT_CHARSET=UTF-8
+eval_gettext () {
+ local myMESSAGE=$(gettext "$1")
+ eval echo \"$myMESSAGE\"
+}
+export LANGORG=$LANG
#NUMXWINS=`pidof xwin | wc -w` #w478
#[ $NUMXWINS -gt 1 ] && exit #w478
[ -z $DISPLAY ] || exit #v2.11 from GuestToo.
@@ -105,11 +114,11 @@
#v3.95 recognise more special screens...
DMIDECODE="`dmidecode`"
#recognise EeePC Asus laptop...
[ "`echo "$DMIDECODE" | grep 'Product Name: 701'`" != "" ] && [ "`echo "$DMIDECODE" | grep 'Serial Number: EeePC'`" != "" ] && echo 'timing: 800x480@60' >> /tmp/ddcprobe.txt
- echo -e '\nIf initialization freezes here, press ctrl-c and type "xorgwizard",\nselect "Xorg", choose monitor type and choose video mode.' #v3.99
+ echo -e '\n'$(gettext 'If initialization freezes here, press ctrl-c and type "xorgwizard",\nselect "Xorg", choose monitor type and choose video mode.')'' #v3.99
grep '^oem:' /tmp/ddcprobe.txt > /tmp/ddcprobeoem.txt #v3.99 current adapter signature
#get too many weird resolutions, maybe better just only allow these...
#want widescreen/non-vesa resolutions only...
VESAMODES="`Xvesa -listmodes 2>&1 | grep '^0x' | tr ':' ' ' | tr -s ' ' | cut -f 1,2 -d ' '`"
@@ -250,11 +259,11 @@
#v2.11 find out if xorg video drvr exists, else use xorg vesa...
if [ -f /usr/bin/Xorg ];then
if [ -f /etc/X11/xorg.conf ];then
#find location of video chip drivers...
- SPECVESA="`find /usr/lib -noleaf -mount -type f -name vesa_drv.so`"
+ SPECVESA="`find /usr/lib /usr/X11R7/lib -noleaf -mount -type f -name vesa_drv.so 2>/dev/null | grep -v 'backup' | grep -m1 'vesa_drv.so'`" #1201031 bug fix.
if [ "$SPECVESA" ];then
DRVRSPATH="`dirname $SPECVESA`"
#get current driver...
DRVRCURR="`cat /etc/X11/xorg.conf | grep '#card0driver' | cut -f 2 -d '"'`" #'
if [ "$DRVRCURR" ];then
@@ -261,13 +270,11 @@
#if [ ! -f $DRVRSPATH/${DRVRCURR}_drv.so ];then
#one driver is mtx_drv.o hmmm, okay do it this way (pakt)...
ls -1 $DRVRSPATH/* | grep $DRVRCURR >/dev/null
if [ $? -ne 0 ];then
APATTERN="s/.*#card0driver/ Driver \"vesa\" #card0driver/g"
- cat /etc/X11/xorg.conf | sed -e "$APATTERN" > /tmp/xorg.conf.tmp2
- sync
- cp -f /tmp/xorg.conf.tmp2 /etc/X11/xorg.conf
+ sed -i -e "$APATTERN" /etc/X11/xorg.conf
fi
fi
fi
fi
fi
@@ -348,26 +355,26 @@
# rm -f /etc/.XLOADED #otherwise cannot start X.
# exit
# fi
if [ "`cat /etc/.XLOADED`" = "true" ];then
#last time X ran, PC hung and had to be rebooted...
- dialog --timeout 30 --title "Warning" --yes-label "Ignore" --no-label "Commandline" --yesno "X seems to have exited uncleanly the last time you ran Puppy. This is usually because of an improper shutdown (such as a power failure), but may be because something is broken.
+ dialog --timeout 30 --title "$(gettext 'Warning')" --yes-label "$(gettext 'Ignore')" --no-label "$(gettext 'Commandline')" --yesno "$(gettext 'X seems to have exited uncleanly the last time you ran Puppy. This is usually because of an improper shutdown (such as a power failure), but may be because something is broken.')
-If it was just something like a power failure, wait for 30 seconds or choose <Ignore> for normal startup of X...
+$(gettext 'If it was just something like a power failure, wait for 30 seconds or choose <Ignore> for normal startup of X...')
-If there is a problem, such as X not working, choose <Commandline> to drop out to a commandline. There will then be further advice how to fix X...
+$(gettext 'If there is a problem, such as X not working, choose <Commandline> to drop out to a commandline. There will then be further advice how to fix X...')
-If undecided, wait 30 seconds for normal startup of X..." 0 0
+$(gettext 'If undecided, wait 30 seconds for normal startup of X...')" 0 0
if [ ! $? = 1 ]; then
rm /etc/.XLOADED
else
echo -en "\\033[1;31m" #34=blue, 33=yellow, 32=green, 31=red, 35=purple, 36=aquablue, 38=black.
echo '
-It seems that last time X ran, the computer hung and you had to reboot.
-Have now dropped down to the commandline. If you want to run the Xorg
-Video Wizard, type "xorgwizard", and after configuring /etc/X11/xorg.conf
-(hopefully correctly this time!) type "xwin" to start X.'
+'$(gettext 'It seems that last time X ran, the computer hung and you had to reboot.')'
+'$(gettext 'Have now dropped down to the commandline. If you want to run the Xorg')'
+'$(gettext 'Video Wizard, type "xorgwizard", and after configuring /etc/X11/xorg.conf')'
+'$(gettext '(hopefully correctly this time!) type "xwin" to start X.')''
echo -e "\\033[0;39m"
rm -f /etc/.XLOADED #otherwise cannot start X.
exit
fi
fi
@@ -380,15 +387,15 @@
cat /tmp/videomode | grep " 800x600"
if [ $? -eq 0 ];then #=0 if found.
if [ -e /tmp/Xflag ];then
#we have just attempted 800x600x16 and aborted with ctrl-alt-backspace
#so have failed.
- echo "An attempt has just been made to run X at 800x600x16 but it has"
- echo "not worked (or it did but you did not press the OK button in the"
- echo "Video-wizard). It is not feasible to run Puppy at any lower resolution"
- echo -e "or color. If you want to try again, type \"xwin\" at the prompt."
- echo "It may be helpful to look in /tmp/xerrs.txt for error messages"
+ echo "$(gettext 'An attempt has just been made to run X at 800x600x16 but it has')"
+ echo "$(gettext 'not worked (or it did but you did not press the OK button in the')"
+ echo "$(gettext 'Video-wizard). It is not feasible to run Puppy at any lower resolution')"
+ echo -e "$(gettext 'or color. If you want to try again, type "xwin" at the prompt.')"
+ echo "$(gettext 'It may be helpful to look in /tmp/xerrs.txt for error messages')"
rm -f /tmp/videomode
rm -f /tmp/Xflag
echo -n "0x0111 640x480x16" > /etc/videomode #desparate.
exit 0
else
@@ -464,11 +471,11 @@
*) XKEYMAP="$xCONSKEYMAP" ;;
esac
if [ -d /etc/X11/xkb/symbols/pc ];then #100127 fallback...
if [ ! -f /etc/X11/xkb/symbols/pc/${XKEYMAP} ];then
if [ ! -f /etc/X11/xkb/symbols/${XKEYMAP} ];then
- echo "ERROR: Console keyboard `cat /etc/keymap` no matching Xorg layout. PLEASE REPORT TO BK"
+ echo "$(gettext 'ERROR: Console keyboard') `cat /etc/keymap` $(gettext 'no matching Xorg layout. PLEASE REPORT TO BK')"
XKEYMAP='us'
fi
fi
fi
currXKEYMAP="`grep '#xkeymap0' /etc/X11/xorg.conf | tr '\t' ' ' | tr -s ' ' | cut -f 4 -d '"'`" #'geany fix
@@ -484,11 +491,11 @@
#J_Rey had a good idea, flag XLOADED... and set to false on exit.
#but if PC hangs, XLOADED will still be true, so will know it is broken.
echo -n "true" > /etc/.XLOADED
case $HAVEX in
Xvesa)
- echo "Starting X with video mode $VIDMODE and mouse $MOUSEDEV..."
+ echo "`eval_gettext \"Starting X with video mode \\\$VIDMODE and mouse \\\$MOUSEDEV...\"`"
#w479 older Xvesa server may not recognise the '-sp' option...
if [ "`Xvesa -help 2>&1 | grep '^\-sp '`" = "" ];then
SPOPTION=''
else
SPOPTION='-sp /usr/lib/xserver/SecurityPolicy'
@@ -505,24 +512,24 @@
echo "$VIDSCRN" > /tmp/currentvideomode
/usr/bin/xinit /root/.xinitrc -- -screen $VIDSCRN $XEXTRAOPTIONS -mouse /dev/mouse,$MOUSEBUTTONS -fp /usr/share/X11/fonts/misc/,/usr/share/X11/fonts/TTF/,/usr/share/X11/fonts/Type1/ $SPOPTION > /tmp/xerrs.log 2>&1
fi
;;
Xfbdev)
- echo "Starting X with Xfbdev Kdrive X server, mouse $MOUSEDEV..."
+ echo "$(gettext 'Starting X with Xfbdev Kdrive X server, mouse') $MOUSEDEV..."
/usr/bin/xinit /root/.xinitrc -- -mouse /dev/mouse,$MOUSEBUTTONS > /tmp/xerrs.log 2>&1
;;
Xi810) #v1.0.7
- echo "Starting X with Xi810 Kdrive X server, mouse $MOUSEDEV..."
+ echo "$(gettext 'Starting X with Xi810 Kdrive X server, mouse') $MOUSEDEV..."
#echo "(experimental, currently fixed to 1024x768x16x72 in /usr/bin/xwin)"
/usr/bin/xinit /root/.xinitrc -- -screen $VIDSCRN -mouse /dev/mouse,$MOUSEBUTTONS > /tmp/xerrs.log 2>&1
;;
XF86_SVGA)
- echo "Starting X, specs in /etc/X11/XF86Config, startup apps /root/.xinitrc..."
+ echo "$(gettext 'Starting X, specs in /etc/X11/XF86Config, startup apps /root/.xinitrc...')"
/usr/bin/xinit /root/.xinitrc -- -bpp 16 > /tmp/xerrs.log 2>&1
;;
Xorg)
- echo "Starting X, specs in /etc/X11/xorg.conf, startup apps /root/.xinitrc..."
+ echo "$(gettext 'Starting X, specs in /etc/X11/xorg.conf, startup apps /root/.xinitrc...')"
#v2.11 G2 suggested -br for black background instead of checked...
#w479 ***AWFUL HACK*** running pup 218, retro k2.6.18.8, my laptop, Xorg hangs
# if have '-nolisten tcp'. until find out why, this workaround...
if [ "$KERNELVER" = "2.6.18.8" ];then
/usr/bin/xinit /root/.xinitrc -- -br > /tmp/xerrs.log 2>&1
@@ -535,28 +542,29 @@
;;
esac
echo -n "false" > /etc/.XLOADED #see note above.
#...if PC hung, run xorgwizard at next bootup (see further up).
-echo 'Exited from X. Type "xwin [fvwm95|jwm]" to restart X ([ ] mean optional).'
-echo '(To shutdown PC type "poweroff", to reboot PC type "reboot")'
+#unicode_start #i18n rodin.s for unicode start after exit from X. ??????what is this??????
+echo ''$(gettext 'Exited from X. Type "xwin [fvwm95|jwm]" to restart X ([ ] mean optional).')''
+echo ''$(gettext '(To shutdown PC type "poweroff", to reboot PC type "reboot")')''
if [ -f /usr/X11R7/bin/Xfbdev ];then
- echo '(To run the Xfbdev Framebuffer Wizard, type "framebufferwizard")'
+ echo ''$(gettext '(To run the Xfbdev Framebuffer Wizard, type "framebufferwizard")')''
fi
if [ "$HAVEX" = "XF86_SVGA" ];then #v1.0.7
echo -en "\\033[1;31m" #34=blue, 33=yellow, 32=green, 31=red, 35=purple, 36=aquablue, 38=black.
- echo 'If X failed to start, type "xf86config" to setup X'
- echo ' -- you will need to know type of mouse, keyboard and video chip'
- echo ' -- thix X is for pre-2000 video chips, but many recent chips backwards-compat.'
- echo ' -- accept default save /etc/XF86Config, Puppy will move this to /etc/X11'
- echo ' -- (XF86Config is the configuration file for X and can be edited manually)'
- echo -n ' -- LAST RESORT, drop back to Xvesa by typing "ln -sf Xvesa /usr/bin/X"'
+ echo ''$(gettext 'If X failed to start, type "xf86config" to setup X')''
+ echo ' -- '$(gettext 'you will need to know type of mouse, keyboard and video chip')''
+ echo ' -- '$(gettext 'thix X is for pre-2000 video chips, but many recent chips backwards-compat.')''
+ echo ' -- '$(gettext 'accept default save /etc/XF86Config, Puppy will move this to /etc/X11')''
+ echo ' -- '$(gettext '(XF86Config is the configuration file for X and can be edited manually)')''
+ echo -n ' -- '$(gettext 'LAST RESORT, drop back to Xvesa by typing "ln -sf Xvesa /usr/bin/X"')''
echo -e "\\033[0;39m"
fi
if [ "$HAVEX" = "Xorg" ];then #v1.0.7
echo -en "\\033[1;35m" #34=blue, 33=yellow, 32=green, 31=red, 35=purple, 36=aquablue, 38=black.
- echo -n 'If X failed to start, type "xorgwizard" to setup X'
+ echo -n ''$(gettext 'If X failed to start, type "xorgwizard" to setup X')''
echo -e "\\033[0;39m"
fi
##w477 weird situation. first boot, xvesa, 'Exit to prompt', X restarts.
##because there are two instances of xwin running, but I don't see how.
Changes to woof-code/rootfs-skeleton/usr/sbin/xorgwizard
@@ -58,18 +58,17 @@
#110911 'drivers-alternate' moved from /usr/lib/xorg/modules/ to /usr/lib/x/.
#110927 fix touchpad setup.
#111108 Karl Godt: fix for desktop drive icons getting drawn in wrong place after change resolution.
#120129 jemimah: add Option "SHMConfig" "on".
#120130 rodin.s: i18n internationalise script. BK: note, edited all changes manually, as script from rodin.s had some differences.
+#120131 rodin.s: added a couple more translations.
[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
export TEXTDOMAIN=xorgwizard
-export TEXTDOMAINDIR=/usr/share/locale
export OUTPUT_CHARSET=UTF-8
. gettext.sh
-export LANGORG=$LANG
mkdir -p /usr/lib/x/drivers-backup
mkdir -p /var/local/xorg #100902
alternate_driver_func() { #100401 100708
@@ -156,23 +155,23 @@
[ -f /usr/lib/x/drivers-alternate/$SUBSTDRV ] && cp -f /usr/lib/x/drivers-alternate/$SUBSTDRV /usr/lib/xorg/modules/drivers/
;;
esac
if [ "$REPLACEDDRV" -o "$REPLACEDDRV2" ];then
REPLACEDDRV0="${REPLACEDDRV}${REPLACEDDRV2}"
- XMSG1="NOTICE: The '${REPLACEDDRV0}' driver has been removed, so when Xorg probes the video hardware, it should instead use '${SUBSTDRV}'.
+ XMSG1="`eval_gettext \"NOTICE: The '\\\${REPLACEDDRV0}' driver has been removed, so when Xorg probes the video hardware, it should instead use '\\\${SUBSTDRV}'.
-TECHNICAL NOTE: '${REPLACEDDRV0}' has been moved to /usr/lib/x/drivers-alternate and if you ever want to manually get it back so that Xorg can use it, move it to /usr/lib/xorg/modules/drivers. Note that there may also be one or more directories inside /usr/lib/x/drivers-alternate with library files needed for the alternate drivers.
+TECHNICAL NOTE: '\\\${REPLACEDDRV0}' has been moved to /usr/lib/x/drivers-alternate and if you ever want to manually get it back so that Xorg can use it, move it to /usr/lib/xorg/modules/drivers. Note that there may also be one or more directories inside /usr/lib/x/drivers-alternate with library files needed for the alternate drivers.
-Press ENTER key to continue..."
+Press ENTER key to continue...\"`"
if [ "$REPLACEDDRV" -a "$REPLACEDDRV2" ];then
- XMSG1="NOTICE: The '${REPLACEDDRV}' and '${REPLACEDDRV2}' drivers have been removed, so when Xorg probes the video hardware, it should instead use '${SUBSTDRV}'.
+ XMSG1="`eval_gettext \"NOTICE: The '\\\${REPLACEDDRV}' and '\\\${REPLACEDDRV2}' drivers have been removed, so when Xorg probes the video hardware, it should instead use '\\\${SUBSTDRV}'.
-TECHNICAL NOTE: '${REPLACEDDRV}' and '${REPLACEDDRV2}' have been moved to /usr/lib/x/drivers-alternate and if you ever want to manually get them back so that Xorg can use them, move them to /usr/lib/xorg/modules/drivers. Note that there may also be one or more directories inside /usr/lib/x/drivers-alternate with library files needed for the alternate drivers.
+TECHNICAL NOTE: '\\\${REPLACEDDRV}' and '\\\${REPLACEDDRV2}' have been moved to /usr/lib/x/drivers-alternate and if you ever want to manually get them back so that Xorg can use them, move them to /usr/lib/xorg/modules/drivers. Note that there may also be one or more directories inside /usr/lib/x/drivers-alternate with library files needed for the alternate drivers.
-Press ENTER key to continue..."
+Press ENTER key to continue...\"`"
fi
- dialog --title "Xorg Video Wizard" --msgbox "${XMSG1}" 0 0
+ dialog --title "$(gettext 'Xorg Video Wizard')" --msgbox "${XMSG1}" 0 0
fi
#restart wizard after return.
} #end alternate_driver_func
# redirect errors to file (to help debug):