Check-in [6e0f3af7f1]
Not logged in

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

Overview

SHA1 Hash:6e0f3af7f1493654be4c72234e4cedc0cc939077
Date: 2012-02-05 13:53:49
User: BarryK
Comment:first release of MoManager: international translation creator for Puppy

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/sbin/momanager

@@ -1,1 +1,322 @@
+#!/bin/sh
+#(c) Barry Kauler Feb 2012 bkhome.org
+#licence GPL3 refer /usr/share/doc/legal
+#the intention of this script is to manage non-english translations of files.
+#this is to include shell scripts, xml, .desktop and menu files.
+#translation will only be for the current language, and UTF-8 must be enabled.
+#120205 first release.
+
+PARAM1=""
+[ $1 ] && PARAM1="$1"
+
+ORIGLANG=$LANG
+export LANG=C
+. /etc/rc.d/PUPSTATE
+GTKDIALOGEXE="gtkdialog"
+[ "`which gtkdialog4`" ] && GTKDIALOGEXE="gtkdialog4"
+mkdir -p /tmp/momanager
+ADATE="`date +%Y%m%d`" #ex: 20120205
+
+ORIGLANG1="`echo -n $ORIGLANG | cut -f 1 -d '_'`"  #ex: de
+ORIGLANG12="`echo -n $ORIGLANG | cut -f 1 -d '.'`" #ex: de_DE
+
+if [ "$ORIGLANG1" = "en" ];then
+ pupdialog --title "MoManager: abort" --background pink --colors --msgbox "This application is intended for creation and editing of non-English translations of scripts, but your locale is currently \Zb${ORIGLANG}\ZB. Click the \Zbsetup\ZB icon on the desktop to change locale (and be sure to enable UTF-8). Aborting." 0 0
+ exit 1
+fi
+if [ "`echo -n $ORIGLANG | grep -i 'utf'`" = "" ];then
+ pupdialog --title "MoManager: abort" --background pink --colors --msgbox "Sorry, your \Zblocale\ZB (language) must have UTF-8 enabled to use this application. Click the \Zbsetup\ZB icon on the desktop to change locale. Aborting." 0 0
+ exit 1
+fi
+if [ "`which gcc`" = "" ];then
+ pupdialog --title "MoManager: abort" --background pink --colors --msgbox "Sorry, you must have the \Zbdevx\ZB SFS loaded. Aborting." 0 0
+ exit 1
+fi
+MISSINGFILE=""
+[ "`which intltool-update`" = "" ] && MISSINGFILE="intltool-update "
+[ "`which xgettext`" = "" ] && MISSINGFILE="${MISSINGFILE}xgettext "
+[ "`which msginit`" = "" ] && MISSINGFILE="${MISSINGFILE}msginit "
+[ "`which msgfmt`" = "" ] && MISSINGFILE="${MISSINGFILE}msgfmt "
+[ "`which msgunfmt`" = "" ] && MISSINGFILE="${MISSINGFILE}msgunfmt"
+if [ "$MISSINGFILE" ];then
+ pupdialog --title "MoManager: abort" --background pink --colors --msgbox "Sorry, these needed applications are missing: \Zb${MISSINGFILE}\ZB. The \Zbdevx\ZB SFS normally has these, but it must be incomplete. Aborting." 0 0
+ exit 1
+fi
+
+PATHPREFIX=""
+case $PUPMODE in
+ 2) PATHPREFIX="" ;; #full hd installation.
+ 3) PATHPREFIX="" ;;
+ *) PATHPREFIX="/initrd/pup_ro2" ;;
+esac
+if [ "$PATHPREFIX" = "" ];then
+ pupdialog --title "MoManager: abort" --background pink --msgbox "Sorry, the PUPMODE must be a value greater than 3, that is, not be a full hd installation. Aborting." 0 0
+ exit 1
+fi
+ppPTN="s%${PATHPREFIX}%%"
+
+#download woof, to get latest files... no, too difficult, just put up warning...
+export MM1_DLG="<window title=\"MoManager: welcome\" window_position=\"1\" resizable=\"false\">
+ <vbox>
+  <text><label>Welcome, MoManager will help you to create and edit language translations for your country, for many of the applications in Puppy. MoManager only handles shell scripts and some XML data and .desktop menu files, binary compiled executables are not handled.</label></text>
+  <text><label>VERY IMPORTANT: You must be currently running a Puppy built from the latest version of Woof, or very near latest. If your Puppy is even a month old, it is recommended that you check for a later release -- and be sure that it is built from the latest Woof. You can check my blog (bkhome.org/blog) for release announcements, or adventurous developers can even download Woof and build their own Puppy (the online Woof repository at bkhome.org/fossil/woof2.cgi has link to instructions)</label></text>
+  <text><label>If you are currently running a very recent Woof-built Puppy, then click the 'OK' button to continue running MoManager:</label></text>
+  <hbox>
+   <button ok></button>
+   <button cancel></button>
+  </hbox>
+ </vbox>
+</window>
+"
+if [ ! "$PARAM1" ];then #on reentry, bypass this window.
+ MM1RET="`$GTKDIALOGEXE --program=MM1_DLG`"
+ [ "`echo "$MM1RET" | grep 'OK'`" = "" ] && exit 2
+fi
+
+yaf-splash -close never -bg orange -text "Please wait, scanning files..." &
+yPID=$!
+
+#find all gettext'ed scripts...
+#GETTEXTSCRIPTS="`find ${PATHPREFIX}/bin ${PATHPREFIX}/sbin ${PATHPREFIX}/usr/bin ${PATHPREFIX}/usr/sbin ${PATHPREFIX}/usr/X11R7/bin ${PATHPREFIX}/usr/local ${PATHPREFIX}/etc/rc.d -maxdepth 4 -type f -executable | xargs -I INPUTFILE grep --files-with-matches '^export TEXTDOMAIN=' INPUTFILE | sed -e 's% %SPACECHAR%g' -e "$ppPTN" | sort | tr '\n' ' '`"
+GETTEXTSCRIPTS="`find /bin /sbin /usr/bin /usr/sbin /usr/X11R7/bin /usr/local /etc/rc.d /root/my-applications/bin -maxdepth 4 -type f -executable | xargs -I INPUTFILE grep --files-with-matches '^export TEXTDOMAIN=' INPUTFILE | sed -e 's% %SPACECHAR%g' | sort | tr '\n' ' '`"
+
+
+#find all matching .mo files...
+YESCNT=0; NOCNT=0; YESMO_XML=""; NOMO_XML=""
+for AGTS in $GETTEXTSCRIPTS
+do
+ xAGTS="`echo -n $AGTS | sed -e 's%SPACECHAR% %g'`"
+ TEXTDOMAINVALUE="`grep '^export TEXTDOMAIN=' "$xAGTS" | cut -f 2 -d '=' | tr '\t' ' ' | cut -f 1 -d ' '`"
+
+ #want to know if from Woof or a builtin pkg or later-installed pkg...
+ BASExAGTS="`basename "$xAGTS"`"
+ xPTN=" ${BASExAGTS}$"
+ PATHxAGTS="`dirname "$xAGTS"`"
+ xxPTN="^${PATHxAGTS}$"
+ zPTN="^${xAGTS}$"
+ aPKGNAME="`grep "$xPTN" /root/.packages/builtin_files/* | head -n 1 | cut -f 1 -d ':' | rev | cut -f 1 -d '/' | rev`" #test pkg used in Woof build.
+ if [ "$aPKGNAME" ];then #confirm full path.
+  CONFIRM="`cat /root/.packages/builtin_files/${aPKGNAME} | sed -e 's%^ %/%' | tr -d '\n' | grep "$xAGTS"`"
+  [ ! "$CONFIRM" ] && aPKGNAME=""
+ fi
+ [ ! "$aPKGNAME" ] && aPKGNAME="`grep "$zPTN" /root/.packages/*.files 2>/dev/null | cut -f 1 -d ':' | rev | cut -f 1 -d '/' | rev | sed -e 's%\.files$%%'`" #test if user-installed pkg.
+ #...return nothing if in Woof
+ [ ! "$aPKGNAME" ] && [ -f "${PATHPREFIX}${xAGTS}" ] && aPKGNAME="WOOF" #file is in Woof.
+ [ ! "$aPKGNAME" ] && aPKGNAME="UNKNOWN"
+
+ FNDMO=""
+ if [ -f /usr/share/locale/${ORIGLANG12}/LC_MESSAGES/${TEXTDOMAINVALUE}.mo ];then
+  FNDMO="/usr/share/locale/${ORIGLANG12}/LC_MESSAGES/${TEXTDOMAINVALUE}.mo"
+  TRANSLANG=$ORIGLANG12
+ else
+  if [ -f /usr/share/locale/${ORIGLANG1}/LC_MESSAGES/${TEXTDOMAINVALUE}.mo ];then
+   FNDMO="/usr/share/locale/${ORIGLANG1}/LC_MESSAGES/${TEXTDOMAINVALUE}.mo"
+   TRANSLANG=$ORIGLANG1
+  fi
+ fi
+ if [ "$FNDMO" ];then
+  YESCNT=$(($YESCNT + 1))
+#  YESMO_XML="${YESMO_XML}
+#<radiobutton><variable>YESRAD${YESCNT}</variable><label>${xAGTS} (${TRANSLANG} ${TEXTDOMAINVALUE}.mo)</label></radiobutton>"
+  YESMO_XML="${YESMO_XML}
+<item>${xAGTS} (${TRANSLANG} ${TEXTDOMAINVALUE}.mo ${aPKGNAME})</item>"
+ else
+  NOCNT=$(($NOCNT + 1))
+#  NOMO_XML="${NOMO_XML}
+#<radiobutton><variable>NORAD${NOCNT}</variable><label>${xAGTS}</label></radiobutton>"
+  NOMO_XML="${NOMO_XML}
+<item>${xAGTS} (${TEXTDOMAINVALUE} ${aPKGNAME})</item>"
+ fi
+done
+if [ "$YESMO_XML" ];then
+ YESMO_XML="<combobox width-request=\"370\"><variable>YESMO_COMBO</variable>${YESMO_XML}</combobox>"
+else
+ YESMO_XML="<text><label>nothing</label></text>"
+fi
+if [ "$NOMO_XML" ];then
+ NOMO_XML="<combobox width-request=\"370\"><variable>NOMO_COMBO</variable>${NOMO_XML}</combobox>"
+else
+ YESMO_XML="<text><label>nothing</label></text>"
+fi
+
+export MM2_DLG="<window title=\"MoManager: Puppy files\" window_position=\"1\" resizable=\"false\">
+ <vbox>
+
+  <frame Scripts>
+  <hbox>
+   <text><label>Puppy has many 'scripts', applications that are plain text files, usually written in Bash or Ash. These scripts all have English capability, but language translation files may be created for them, known as 'mo' files as their filename ends with '.mo'.</label></text>
+   <text><label>Note that the drop-down lists below have extra information in brackets, in the format ([lang ]TEXTDOMAIN package). In particular, package=WOOF means the file is in Woof, or the name of the package from which the file comes is given, or if not known then package=UNKNOWN.</label></text>
+  </hbox>
+  <hbox>
+   <vbox>
+    <frame Scripts that have a mo file>
+     <text><label>A translation file in your language (${ORIGLANG12}) will be at /usr/share/locale/${ORIGLANG12}/LC_MESSAGES/ or /usr/share/locale/${ORIGLANG1}/LC_MESSAGES/. You may select one of the scripts, then click the 'Edit' button to update it...</label></text>
+     ${YESMO_XML}
+     <hbox><button><label>Edit</label><action>EXIT:edit_mo</action></button></hbox>
+    </frame>
+   </vbox>
+   <vbox>
+    <frame Scripts that do not have a mo file>
+     <text><label>These scripts do not have a translation file for your language. You may select one of the scripts, then click the 'Create' button to create a translation...</label></text>
+     ${NOMO_XML}
+     <hbox><button><label>Create</label><action>EXIT:create_mo</action></button></hbox>
+    </frame>
+   </vbox>
+  </hbox>
+  </frame>
+
+  <frame Menu>
+   <text><label>coming soon</label></text>
+  </frame>
+
+  <frame ROX-Filer>
+   <text><label>coming soon</label></text>
+  </frame>
+
+  <hbox>
+   <button><label>About</label><action>pupdialog --background '#8080FF' --backtitle 'MoManager: About' --msgbox 'Created by Barry Kauler for Puppy Linux. (c) Copyright Barry Kauler 2012, license GPL3 (refer /usr/share/doc/legal)' 0 0 & </action></button>
+   <button><label>Exit</label><action>EXIT:quit</action></button>
+  </hbox>
+
+ </vbox>
+</window>
+"
+echo "$MM2_DLG" > /tmp/xxx #TEST
+kill $yPID
+
+MM1RET="`$GTKDIALOGEXE --program=MM2_DLG`"
+eval "$MM1RET"
+
+#note: edit_mo and create_mo have much common code, *to do* eliminate duplication.
+GZNOTE="Note, if you are very security-conscious and want to check for yourself what is in that file before you email it, gunzip it, then use application 'msgunfmt' to de-compile it and view it's contents."
+case $EXIT in
+ edit_mo)
+  #ex: YESMO_COMBO='/usr/sbin/mousecheck (de mousecheck.mo)'
+  ASCRIPT="`echo -n "$YESMO_COMBO" | cut -f 1 -d '(' | rev | cut -f 2 -d ' ' | rev`"
+  ANAME="`basename "$ASCRIPT"`"
+  ATRANSLANG="`echo -n "$YESMO_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ' '`" #ex: de
+  AMO="`echo -n "$YESMO_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ')' | cut -f 2 -d ' '`" #ex: mousecheck.mo
+  APKGNAME="`echo -n "$YESMO_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ')' | cut -f 3 -d ' '`" #ex: bluefish  ex: WOOF
+  AMOSPEC="/usr/share/locale/${ATRANSLANG}/LC_MESSAGES/${AMO}"
+  ATEXTDOMAIN="`basename $AMO .mo`"
+  cp -f "$AMOSPEC" /tmp/momanager/${ATEXTDOMAIN}.moOLD
+  msgunfmt "$AMOSPEC" > /tmp/momanager/${ATEXTDOMAIN}1.po
+  cd /tmp/momanager
+
+#  mv -f ${ATEXTDOMAIN}.po ${ATEXTDOMAIN}.pot #hack
+  cp -f "$ASCRIPT" ${ANAME}.sh #hack
+#  rxvt -e xgettext --join-existing --no-wrap -o ${ATEXTDOMAIN}.pot ${ANAME}.sh #hack
+#  #get rid of strings from .mo that no longer exist...
+#  #TODO
+#  rxvt -e msginit --no-wrap --locale=${ORIGLANG12} --output-file=${ATEXTDOMAIN}.po --input=${ATEXTDOMAIN}.pot
+  rxvt -e xgettext --no-wrap -o ${ATEXTDOMAIN}.pot ${ANAME}.sh
+  #this syncs textdomain1.po and textdomain.pot, merges to textdomain.po ...
+  rxvt -e intltool-update --dist --gettext-package=${ATEXTDOMAIN} --output-file=${ATEXTDOMAIN}.po ${ATEXTDOMAIN}1
+
+  sync
+  killall geany 2> /dev/null #otherwise geany will return immediately and continue executing this script.
+  echo '#!/bin/sh
+  sleep 3
+  yaf-splash -bg yellow -placement top -timeout 9 -text "The .mo file has been converted to an editable .po file. Edit, then Save, then Quit text editor..."
+  ' > /tmp/momanager/yafmsg
+  chmod 755 /tmp/momanager/yafmsg
+  /tmp/momanager/yafmsg & #msg has delay so will appear on top of text editor window.
+  defaulttexteditor /tmp/momanager/${ATEXTDOMAIN}.po
+  rxvt -e msgfmt --check --output-file=/tmp/momanager/${ATEXTDOMAIN}.mo /tmp/momanager/${ATEXTDOMAIN}.po
+  pupdialog --background yellow --colors --backtitle "MoManager: post-edit mo" --yes-label "OK" --no-label "Cancel" --yesno "The file /tmp/momanager/${ATEXTDOMAIN}.po has been edited and converted to /tmp/momanager/${ATEXTDOMAIN}.mo. If all went well, click the \ZbOK\ZB button to copy it to \Zb${AMOSPEC}\ZB. Note, as a precaution, the old mo file is at /tmp/momanager/${ATEXTDOMAIN}.moOLD." 0 0
+  if [ $? -eq 0 ];then
+   cp -f /tmp/momanager/${ATEXTDOMAIN}.mo "${AMOSPEC}"
+   cd /tmp/momanager
+   rm -f ${ATEXTDOMAIN}.mo.gz 2>/dev/null
+   gzip ${ATEXTDOMAIN}.mo
+   ASTAT="`stat --format=%y "$ASCRIPT" | cut -f 1 -d ' ' | tr -d '-' `" #so can check against file version in latest Woof.
+   mv -f /tmp/momanager/${ATEXTDOMAIN}.mo.gz /root/${ASTAT}_${ADATE}_${ATRANSLANG}_${ATEXTDOMAIN}.mo.gz
+   case $APKGNAME in
+    WOOF)
+     DONEMSG="Ok, the new .mo file is in place, and if you wish you may run the script to test it. The script ${ANAME} is part of Woof, so if the translation works, please email it to Barry Kauler so that it may be included in Woof for all future Puppy builds. File \Zb/root/${ASTAT}_${ADATE}_${ATRANSLANG}_${ATEXTDOMAIN}.mo.gz\ZB has been created, that you can email to Barry at: \Zbbkauler@gmail.com\ZB -- thanks, that will be very helpful for internationalization of Puppy!"
+    ;;
+    UNKNOWN)
+     DONEMSG="Ok, the new .mo file is in place, and if you wish you may run the script to test it. The script ${ANAME} does not seem to be part of Woof, nor can it be determined if it is part of a package. if you know who the author of the script is, you might wish to send the translation file to that person -- file \Zb/root/${ASTAT}_${ADATE}_${ATRANSLANG}_${ATEXTDOMAIN}.mo.gz\ZB has been created, that you can email to someone."
+    ;;
+    *)
+     DONEMSG="Ok, the new .mo file is in place, and if you wish you may run the script to test it. The script ${ANAME} appears to be part of package ${APKGNAME}, and you may wish to send the translation file to the author of that package -- file \Zb/root/${ASTAT}_${ADATE}_${ATRANSLANG}_${ATEXTDOMAIN}.mo.gz\ZB has been created, that you can email to someone."
+    ;;
+   esac
+   pupdialog --background green --colors --backtitle "MoManager: mo edit completed" --msgbox "${DONEMSG}
+${GZNOTE}" 0 0
+  else
+   pupdialog --background pink --backtitle "MoManager: mo edit aborted" --msgbox "You have declined to update the mo file. Ok, the previous one has been retained." 0 0
+  fi
+  export LANG=$ORIGLANG
+  exec momanager reenter
+ ;;
+ create_mo)
+  #ex: NOMO_COMBO='/usr/sbin/mousecheck (mousecheck)'
+  ASCRIPT="`echo -n "$NOMO_COMBO" | cut -f 1 -d '(' | rev | cut -f 2 -d ' ' | rev`"
+  ATEXTDOMAIN="`echo -n "$NOMO_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ' '`"
+  APKGNAME="`echo -n "$NOMO_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ')' | cut -f 2 -d ' '`" #ex: bluefish  ex: WOOFBUILTIN
+  FIELD2ND="`echo -n "$ORIGLANG12" | cut -f 2 -d '_'`"
+  pupdialog --colors --background yellow --backtitle "MoManager: mo language" --yes-label "${ORIGLANG1}" --no-label "${ORIGLANG12}" --yesno "Please click the \Zb${ORIGLANG1}\ZB button to create a translation file for that language. However, the \Zb${FIELD2ND}\ZB designates a particular country in which the language is used, and if you need such a specific translation then click the \Zb${ORIGLANG12}\ZB button. It is highly recommended that you click the \Zb${ORIGLANG1}\ZB button, unless you absolutely must have a country-specific translation..." 0 0
+  if [ $? -eq 0 ];then
+   ATRANSLANG="$ORIGLANG1"
+  else
+   ATRANSLANG="$ORIGLANG12"
+  fi
+#  ATEXTDOMAIN="`basename "$NOMO_COMBO"`"
+#  if [ "`which $ATEXTDOMAIN`" = "" ];then #if not in path, then insert a prefix...
+#   adirspec="`dirname "$NOMO_COMBO"`"
+#   aprefix="`basename "$adirspec" | sed -e 's%[^a-zA-Z0-9]%%g'`"
+#   ATEXTDOMAIN="${aprefix}___${ATEXTDOMAIN}"
+#  fi
+  ANAME="`basename "$ASCRIPT"`"
+  AMO="${ATEXTDOMAIN}.mo"
+  AMOSPEC="/usr/share/locale/${ATRANSLANG}/LC_MESSAGES/${AMO}"
+  mkdir -p /usr/share/locale/${ATRANSLANG}/LC_MESSAGES
+  cp -f "$ASCRIPT" /tmp/momanager/${ANAME}.sh #i think the .sh helps xgettext.
+  cd /tmp/momanager
+  rxvt -e xgettext -o ${ATEXTDOMAIN}.pot --no-wrap ${ANAME}.sh
+  aPTN="s%Project-Id-Version: PACKAGE VERSION%Project-Id-Version: ${ANAME} VERSION%"
+  bPTN="s%Content-Type: text/plain; charset=CHARSET%Content-Type: text/plain; charset=UTF-8%"
+  cPTN="s% PACKAGE package% ${ANAME} package%"
+  sed -i -e "$aPTN" -e "$bPTN" -e "$cPTN" ${ATEXTDOMAIN}.pot
+  rxvt -e msginit --no-wrap --locale=${ORIGLANG12} --output-file=${ATEXTDOMAIN}.po --input=${ATEXTDOMAIN}.pot
+  sync
+  killall geany 2> /dev/null #otherwise geany will return immediately and continue executing this script.
+  echo '#!/bin/sh
+  sleep 3
+  yaf-splash -bg yellow -placement top -timeout 9 -text "The translation file is now open in a text editor. Edit, then Save, then Quit text editor..."
+  ' > /tmp/momanager/yafmsg2
+  chmod 755 /tmp/momanager/yafmsg2
+  /tmp/momanager/yafmsg2 & #msg has delay so will appear on top of text editor window.
+  defaulttexteditor /tmp/momanager/${ATEXTDOMAIN}.po
+  rxvt -e msgfmt --check --output-file=/tmp/momanager/${ATEXTDOMAIN}.mo /tmp/momanager/${ATEXTDOMAIN}.po
+  pupdialog --background yellow --colors --backtitle "MoManager: post-edit mo" --yes-label "OK" --no-label "Cancel" --yesno "The file /tmp/momanager/${ATEXTDOMAIN}.po has been edited and converted to /tmp/momanager/${ATEXTDOMAIN}.mo (the former being the editable translation file and the latter being the compiled translation file). If all went well, click the \ZbOK\ZB button to copy it to \Zb${AMOSPEC}\ZB." 0 0
+  if [ $? -eq 0 ];then
+   cp -f /tmp/momanager/${ATEXTDOMAIN}.mo "${AMOSPEC}"
+   cd /tmp/momanager
+   rm -f ${ATEXTDOMAIN}.mo.gz 2>/dev/null
+   gzip ${ATEXTDOMAIN}.mo
+   ASTAT="`stat --format=%y "$ASCRIPT" | cut -f 1 -d ' ' | tr -d '-' `" #so can check against file version in latest Woof.
+   mv -f /tmp/momanager/${ATEXTDOMAIN}.mo.gz /root/${ASTAT}_${ADATE}_${ATRANSLANG}_${ATEXTDOMAIN}.mo.gz
+   case $APKGNAME in
+    WOOF)
+     DONEMSG="Ok, the new .mo file is in place, and if you wish you may run the script to test it. The script ${ANAME} is part of Woof, so if the translation works, please email it to Barry Kauler so that it may be included in Woof for all future Puppy builds. File \Zb/root/${ASTAT}_${ADATE}_${ATRANSLANG}_${ATEXTDOMAIN}.mo.gz\ZB has been created, that you can email to Barry at: \Zbbkauler@gmail.com\ZB -- thanks, that will be very helpful for internationalization of Puppy!"
+    ;;
+    UNKNOWN)
+     DONEMSG="Ok, the new .mo file is in place, and if you wish you may run the script to test it. The script ${ANAME} does not seem to be part of Woof, nor can it be determined if it is part of a package. if you know who the author of the script is, you might wish to send the translation file to that person -- file \Zb/root/${ASTAT}_${ADATE}_${ATRANSLANG}_${ATEXTDOMAIN}.mo.gz\ZB has been created, that you can email to someone."
+    ;;
+    *)
+     DONEMSG="Ok, the new .mo file is in place, and if you wish you may run the script to test it. The script ${ANAME} appears to be part of package ${APKGNAME}, and you may wish to send the translation file to the author of that package -- file \Zb/root/${ASTAT}_${ADATE}_${ATRANSLANG}_${ATEXTDOMAIN}.mo.gz\ZB has been created, that you can email to someone."
+    ;;
+   esac
+   pupdialog --background green --colors --backtitle "MoManager: mo edit completed" --msgbox "${DONEMSG}
+${GZNOTE}" 0 0
+  else
+   pupdialog --background pink --backtitle "MoManager: mo edit aborted" --msgbox "You have declined to use the mo file. Ok, it has been left at /tmp/momanager/${ATEXTDOMAIN}.mo and will not be used." 0 0
+  fi
+  export LANG=$ORIGLANG
+  exec momanager reenter
+
+ ;;
+esac
 

Changes to woof-code/rootfs-skeleton/usr/sbin/sfsget

@@ -5,10 +5,11 @@
 #$1 optional prefix, sub-directory on the official download URL. ex: wary-5.2/devx.sfs
 #110402 first version.
 #110422 DISTRO_VERSION variable now has dotted format. note, also now using full dotted version# in puppy filenames.
 #110813 bug fix, sfs file has '_' in name.
 #120202 BK: internationalized.
+#120204 more gettext.
 
 export TEXTDOMAIN=sfsget
 export OUTPUT_CHARSET=UTF-8
 
 SFS_FILE=''; SFS_DIR=''
@@ -155,13 +156,13 @@
  for ONEDLSPEC in $DLPARTS
  do
   DEVNODE="`echo -n "$ONEDLSPEC" | cut -f 1 -d '|' | cut -f 3 -d '/'`"
   DEVFS="`echo -n "$ONEDLSPEC" | cut -f 2 -d '|'`"
   DEVSIZEM="`echo -n "$ONEDLSPEC" | cut -f 3 -d '|'`"
-  DLBUTTONS="${DLBUTTONS}<radiobutton><label>${DEVNODE} filesystem: ${DEVFS} size: ${DEVSIZEM}MB</label><variable>RADIO_URL_${DEVNODE}</variable></radiobutton>"
+  DLBUTTONS="${DLBUTTONS}<radiobutton><label>${DEVNODE} $(gettext 'filesystem:') ${DEVFS} $(gettext 'size:') ${DEVSIZEM}MB</label><variable>RADIO_URL_${DEVNODE}</variable></radiobutton>"
  done
- export DL_DIALOG="<window title=\"SFS Downloader: destination\" icon-name=\"gtk-about\" window_position=\"1\">
+ export DL_DIALOG="<window title=\"$(gettext 'SFS Downloader: destination')\" icon-name=\"gtk-about\" window_position=\"1\">
  <vbox>
   <text><label>$(gettext 'This is a first boot of Puppy and you have not yet saved a session. You want to download') ${SFS_FILE}, $(gettext "and this needs to be downloaded to the same partition in which you will be creating the session save-file. Then, at next boot, Puppy will load the session and will also see the SFS file and be able to load that also (a 'zdrv' will load automatically, others need to be manually selected in te BootManager -- see System menu)")</label></text>
   <text><label>$(gettext 'Here is a list of suitable partitions. Whichever one you choose, at shutdown you will be asked to save the session and be sure to choose the same partition. Well, even if you download it to the wrong place, you can move it afterward! Click the one you want:')</label></text>
   <frame>
    ${DLBUTTONS}

Changes to woof-code/rootfs-skeleton/usr/share/applications/MoManager.desktop

@@ -1,1 +1,10 @@
-
+[Desktop Entry]
+Encoding=UTF-8
+Name=MoManager create non-English Puppy
+Icon=chooselocale.xpm
+Comment=MoManager create non-English translations
+Exec=momanager
+Terminal=false
+Type=Application
+Categories=Translation
+GenericName=MoManager

Changes to woof-code/rootfs-skeleton/usr/share/doc/HOWTO-internationalization.htm

@@ -108,12 +108,61 @@
 ...this relies upon the application /usr/sbin/t12s, a GUI app created by
  L18L. It requires the 'yad' package be installed, that is likely to be
 the case in recent puppies.<br>
 
         <br>
+<h2>
 
-It is likely that t12s will be our preferred technique for future internationalized scripts in Puppy.<br>
+MoManager translation manager</h2>
+MoManager is a GUI application written by me (Barry Kauler) that makes it very easy for anyone to
+create non-English translations for applications in Puppy. You must have a Puppy built from a Woof
+version later than February 6, 2012.<br>
+<br>
+MoManager is for creating and updating translation files for scripts,
+XML files and menu files. Scripts are applications that are text files,
+usually written in Bash or Ash. The first release of MoManager only
+handles scripts, specifically, scripts that employ the 'gettext' method
+of translation -- stay tuned for enhancements.<br>
+<br>
+Note, if you are unfamiliar with 'scripts', don't worry, they are just applications.<br>
+<br>
+To use MoManager, the best thing to do is just go ahead and use it. You
+will find it in the 'Utility' menu. Once started, you will see two
+drop-down lists of scripts, one list is of scripts that already have a
+translation file for your language, the other list is for scripts that
+do not yet have a translation file. if you select a file from the former
+ list, you may update the translation, and in the latter case you may
+create a new translation file.<br>
+<br>
+Note that in the case of updating an existing translation file,
+MoManager automatically synchronises with the latest script, and will
+identify any changed strings -- if you see the text "fuzzy" anywhere in
+the translation file, it is likely that the original English text has
+changed and you will need to update the translation.<br>
+<br>
+A translation file for a script means that when the application runs, it
+ will output all text in your language. By creating translation files
+for all the scripts, you can help to create a Puppy that runs nicely in
+your language -- and by sending the translation files to me, I can put
+them into Woof for all future builds of Puppy.<br>
+<br>
+Although it is probably possible to figure out how to edit a translation
+ file, known as a 'po' file in it's editable form, or 'mo' file in it's
+compiled form, it is helpful to readup a bit on the topic. I suggest:<br>
+<div style="margin-left: 40px;"><a href="http://translate.sourceforge.net/wiki/guide/project/howto">http://translate.sourceforge.net/wiki/guide/project/howto</a> <br>
+</div>
+<div style="margin-left: 40px;"><a href="http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html#PO-Files">http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html#PO-Files</a> <br>
+</div>
+<br>
+...note though, reading all of that can be confusing! It is possible to
+use MoManager without understanding all of those details. MoManager uses
+ a normal text editor to edit po files rather than a specialized
+po-editor (such as poedit) and this is quite easy to do, you just need a
+ very basic understanding of the format of po files. <br>
+<br>
+Regards,<br>
+Barry Kauler<br>
 
       </td>
     </tr>
   </tbody>
 </table>

Changes to woof-distro/x86/racy/testing/DISTRO_SPECS

@@ -1,12 +1,12 @@
 #One or more words that identify this distribution:
 DISTRO_NAME='Racy Puppy'
 #version number of this distribution:
-DISTRO_VERSION=5.2.2
+DISTRO_VERSION=5.2.2.4
 #The distro whose binary packages were used to build this distribution:
 DISTRO_BINARY_COMPAT='puppy'
 #Prefix for some filenames: exs: racysave.2fs, racy-5.1.107.sfs
 DISTRO_FILE_PREFIX='racy'
 #The version of the distro whose binary packages were used to build this distro:
 DISTRO_COMPAT_VERSION='wary5'
 #the kernel pet package used:
 DISTRO_KERNEL_PET='linux_kernel-3.0.17-pae-i686-unionfs-w5.pet'