Check-in [398123183f]
Not logged in

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

Overview

SHA1 Hash:398123183f23089ff4e5f5aa7832d32b9375b475
Date: 2012-03-09 10:54:43
User: BarryK
Comment:MoManager support save po files, for cases uncompile mo fails --ex rox-filer

Tags And Properties
Changes

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

@@ -26,10 +26,11 @@
 #120224 add 'doc_strings' sss domain, for translating entire files (typically documentation files). 120225 improvements.
 #120225 checkbox window to select what documentation files to edit. modify edit-complete message.
 #120228 sync doc_strings sss file.
 #120307 ROX-Filer now translated via /usr/share/doc/nls/ROX-Filer/ROX-Filer.pot
 #120308 ROX-Filer .mo files are not in standard location. workaround when intltool-update fails.
+#120309 binary executables, option to retain po file for later editing (instead of uncompile mo).
 
 #***MOMANAGER IS ENGLISH ONLY (NOT GETTEXT'ED)***
 #it is for use by developers/translators with knowledge of english.
 
 PARAM1=""
@@ -108,17 +109,21 @@
 
 echo -n "" > /tmp/momanager/translations4langpack #to create the langpack PET.
 TRANSLANG=""
 
 poptop_func() {
- #passed param is string to display at top of screen.
+ #passed param $1 is string to display at top of screen, optional $2 is color, $3 is timeout.
+ BACKCOL='yellow'
+ [ $2 ] && BACKCOL="$2"
+ POPTIME='9'
+ [ $3 ] && POPTIME="$3"
  echo "#!/bin/sh
  sleep 3
- yaf-splash -bg yellow -placement top -timeout 9 -text \"${1}\"
- " > /tmp/momanager/yafmsg99
- chmod 755 /tmp/momanager/yafmsg99
- /tmp/momanager/yafmsg99 & #msg has delay so will appear on top of text editor window.
+ yaf-splash -bg ${BACKCOL} -placement top -timeout ${POPTIME} -text \"${1}\"
+ " > /tmp/momanager/yafmsg9${POPTIME}
+ chmod 755 /tmp/momanager/yafmsg9${POPTIME}
+ /tmp/momanager/yafmsg9${POPTIME} & #msg has delay so will appear on top of text editor window.
 }
 
 #####SCRIPTS#######
 #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' ' '`"
@@ -453,10 +458,18 @@
 #support a limited number of binary executables that have .pot files in /usr/share/doc/nls
 YESCNT=0 ; NOCNT=0 ; YESBIN_XML="" ; NOBIN_XML=""
 for ANLSDIR in `ls -1 /usr/share/doc/nls | tr '\n' ' '`
 do
  if [ -d  /usr/share/doc/nls/${ANLSDIR} ];then
+
+  #120309 po files may now be there... ex: /usr/share/doc/nls/ROX-Filer/de.po
+  FNDPO="`find /usr/share/doc/nls/${ANLSDIR} -mindepth 1 -maxdepth 1 -type f -name '*.po' | tr '\n' ' '`"
+  for APO in $FNDPO
+  do
+   echo "$APO" >> /tmp/momanager/translations4langpack
+  done
+
   BINEXEC=""
   BINEXEC="`which $ANLSDIR`"
   [ ! "$BINEXEC" ] && BINEXEC="`find /usr/local -maxdepth 4 -executable -type f -name "$ANLSDIR"`" #ex: /usr/local/simple_network_setup/proxy-setup
   if [ "$BINEXEC" ];then
    if [ "`file "$BINEXEC" | grep ' ELF ' | grep 'LSB executable'`" != "" ];then
@@ -732,19 +745,20 @@
   esac
   #this syncs textdomain1.po and textdomain.pot, merges to textdomain.po ...
   rm -f ${ATEXTDOMAIN}.po 2>/dev/null
   LANG=${ORIGLANG} rxvt -e intltool-update --dist --gettext-package=${ATEXTDOMAIN} --output-file=${ATEXTDOMAIN}.po ${ATEXTDOMAIN}1
   BINMSG="The .mo file has been converted to an editable .po file. Edit, then Save, then Quit text editor..."
-  ROPID=0
+  ROPID=0 ; POPCOL='yellow'
   #120308 intltool-update is broken with some pot files. need a fallback method...
   if [ ! -s ${ATEXTDOMAIN}.po ];then
    LANG=${ORIGLANG} rxvt -e msginit --no-wrap --locale=${ORIGLANG12} --output-file=${ATEXTDOMAIN}.po --input=${ATEXTDOMAIN}.pot #create po file without any translations.
    LANG=${ORIGLANG} defaulttextviewer /tmp/momanager/${ATEXTDOMAIN}1.po & #warning, this must be different from defaulttexteditor!
    ROPID=$!
    BINMSG="BAD NEWS: the 'intltool-update' utility was unable to merge your existing translations with the pot file. Therefore, the translations are open in a separate file '${ATEXTDOMAIN}1.po' and you must paste them into '${ATEXTDOMAIN}.po' -- edit the latter only! Edit '${ATEXTDOMAIN}.po', save, then quit..."
-  fi
-  poptop_func "$BINMSG"
+   POPCOL='LightPink'
+  fi
+  poptop_func "$BINMSG" $POPCOL
   if [ "$POEDITOR" ];then
    LANG=${ORIGLANG} ${POEDITOR} /tmp/momanager/${ATEXTDOMAIN}.po
   else
    killall geany 2> /dev/null #otherwise geany will return immediately and continue executing this script.
    sleep 0.5
@@ -769,10 +783,11 @@
    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
@@ -809,16 +824,11 @@
     sed -i -e "$aPTN" -e "$bPTN" -e "$cPTN" ${ATEXTDOMAIN}.pot
    ;;
   esac
   LANG=${ORIGLANG} rxvt -e msginit --no-wrap --locale=${ORIGLANG12} --output-file=${ATEXTDOMAIN}.po --input=${ATEXTDOMAIN}.pot
   sync
-  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.
+  poptop_func "The translation file is now open in a text editor. Edit, then Save, then Quit text editor..."
   if [ "$POEDITOR" ];then
    LANG=${ORIGLANG} ${POEDITOR} /tmp/momanager/${ATEXTDOMAIN}.po
   else
    killall geany 2> /dev/null #otherwise geany will return immediately and continue executing this script.
    sleep 0.5
@@ -855,16 +865,11 @@
    cp -f -a /usr/share/applications/$DESKFILE /tmp/momanager/
    sed -i -e "s%^Name=%Name[${ORIGLANG1}]=PLEASE INSERT YOUR TRANSLATION HERE\\nName=%" /usr/share/applications/$DESKFILE
   fi
   sync
   killall geany 2>/dev/null
-  echo '#!/bin/sh
-  sleep 3
-  yaf-splash -bg yellow -placement top -timeout 9 -text "The menu file is now open in a text editor. Edit, then Save, then Quit text editor..."
-  ' > /tmp/momanager/yafmsg3
-  chmod 755 /tmp/momanager/yafmsg3
-  /tmp/momanager/yafmsg3 & #msg has delay so will appear on top of text editor window.
+  poptop_func "The menu file is now open in a text editor. Edit, then Save, then Quit text editor..."
   ASTAT="`stat --format=%y "/usr/share/applications/$DESKFILE" | cut -f 1 -d ' ' | tr -d '-' `" #so can check against file version in latest Woof.
   [ -f ${PATHPREFIX}/usr/share/applications/$DESKFILE ] && ASTAT="`stat --format=%y "${PATHPREFIX}/usr/share/applications/$DESKFILE" | cut -f 1 -d ' ' | tr -d '-' `" #get orig modify date.
   xASTAT1="`stat --format=%Y "/usr/share/applications/$DESKFILE"`" #seconds since epoch.
   LANG=${ORIGLANG} defaulttexteditor /usr/share/applications/$DESKFILE
   xASTAT2="`stat --format=%Y "/usr/share/applications/$DESKFILE"`" #seconds since epoch.
@@ -897,10 +902,11 @@
   dir2tgz MoManager-${ORIGLANG12}-${APKGNAME}/
   tarball_func
   export LANG=$ORIGLANG
   exec momanager reenter
  ;;
+
  edit_top|create_top) #menu categories.
   APKGNAME='WOOF'
   if [ "$EXIT" = "edit_top" ];then
    TOPFILE="$YESTOP_COMBO"
    cp -f -a /usr/share/desktop-directories/$TOPFILE /tmp/momanager/
@@ -909,16 +915,11 @@
    cp -f -a /usr/share/desktop-directories/$TOPFILE /tmp/momanager/
    sed -i -e "s%^Name=%Name[${ORIGLANG1}]=PLEASE INSERT YOUR TRANSLATION HERE\\nName=%" /usr/share/desktop-directories/$TOPFILE
   fi
   sync
   killall geany 2>/dev/null
-  echo '#!/bin/sh
-  sleep 3
-  yaf-splash -bg yellow -placement top -timeout 9 -text "The menu-category file is now open in a text editor. Edit, then Save, then Quit text editor..."
-  ' > /tmp/momanager/yafmsg4
-  chmod 755 /tmp/momanager/yafmsg4
-  /tmp/momanager/yafmsg4 & #msg has delay so will appear on top of text editor window.
+  poptop_func "The menu-category file is now open in a text editor. Edit, then Save, then Quit text editor..."
   ASTAT="`stat --format=%y "/usr/share/desktop-directories/$TOPFILE" | cut -f 1 -d ' ' | tr -d '-' `" #so can check against file version in latest Woof.
   [ -f ${PATHPREFIX}/usr/share/desktop-directories/$TOPFILE ] && ASTAT="`stat --format=%y "${PATHPREFIX}/usr/share/desktop-directories/$TOPFILE" | cut -f 1 -d ' ' | tr -d '-' `" #get orig modify date.
   xASTAT1="`stat --format=%Y "/usr/share/desktop-directories/$TOPFILE"`" #seconds since epoch.
   LANG=${ORIGLANG} defaulttexteditor /usr/share/desktop-directories/$TOPFILE
   xASTAT2="`stat --format=%Y "/usr/share/desktop-directories/$TOPFILE"`" #seconds since epoch.
@@ -952,10 +953,11 @@
   dir2tgz MoManager-${ORIGLANG12}-${APKGNAME}/
   tarball_func
   export LANG=$ORIGLANG
   exec momanager reenter
  ;;
+
  create_sss) #BK's Simple String Substitution method.
   APKGNAME="WOOF"
   SSSFILE="$NOSSS_COMBO" #ex: menu_strings (located at /usr/share/sss/menu_strings/)
   cp -f /usr/share/sss/$SSSFILE/$SSSFILE /tmp/momanager/$SSSFILE.$ORIGLANG1
   sync
@@ -1015,25 +1017,15 @@
     fi
     killall seamonkey 2>/dev/null
     killall seamonkey-bin 2>/dev/null
     killall geany 2>/dev/null
     [ ! -f "$SSS_TRANSLATION_FILE" ] && cp -a -f $TARGETFILE $SSS_TRANSLATION_FILE
-    echo '#!/bin/sh
-    sleep 3
-    yaf-splash -bg orange -placement top -timeout 9 -text "This is the original English file. Use this for reference only, do not edit. PLEASE WAIT..."
-    ' > /tmp/momanager/yafmsg5a
-    chmod 755 /tmp/momanager/yafmsg5a
-    /tmp/momanager/yafmsg5a & #msg has delay so will appear on top of text editor window.
+    poptop_func "This is the original English file. Use this for reference only, do not edit. PLEASE WAIT..." orange 9
     LANG=${ORIGLANG} ${SSS_HANDLER_VIEWER} "$TARGETFILE" &
     dPID=$!
     sleep 10
-    echo '#!/bin/sh
-    sleep 4
-    yaf-splash -bg yellow -placement top -timeout 11 -text "You must translate all of the text in this file to '${ORIGLANG1}' language. Edit, then Save, then Quit. Note, if you do not want to change anything, just Quit the editor..."
-    ' > /tmp/momanager/yafmsg5b
-    chmod 755 /tmp/momanager/yafmsg5b
-    /tmp/momanager/yafmsg5b & #msg has delay so will appear on top of text editor window.
+    poptop_func "You must translate all of the text in this file to '${ORIGLANG1}' language. Edit, then Save, then Quit. Note, if you do not want to change anything, just Quit the editor..." yellow 11
     xASTAT1="`stat --format=%Y "$SSS_TRANSLATION_FILE"`" #seconds since epoch.
     LANG=${ORIGLANG} ${SSS_HANDLER_EDITOR} ${SSS_TRANSLATION_FILE}
     xASTAT2="`stat --format=%Y "$SSS_TRANSLATION_FILE"`" #seconds since epoch.
     kill $dPID
     [ "$xASTAT1" = "$xASTAT2" ] && continue
@@ -1051,16 +1043,11 @@
    export LANG=$ORIGLANG
    exec momanager reenter
   fi
 
   killall geany 2>/dev/null
-  echo '#!/bin/sh
-  sleep 3
-  yaf-splash -bg yellow -placement top -timeout 9 -text "The SSS file is now open in a text editor. You must only edit between the last two % characters. Edit, then Save, then Quit text editor..."
-  ' > /tmp/momanager/yafmsg5
-  chmod 755 /tmp/momanager/yafmsg5
-  /tmp/momanager/yafmsg5 & #msg has delay so will appear on top of text editor window.
+  poptop_func "The SSS file is now open in a text editor. You must only edit between the last two % characters. Edit, then Save, then Quit text editor..."
   ASTAT="`stat --format=%y "/usr/share/sss/$SSSFILE/$SSSFILE" | cut -f 1 -d ' ' | tr -d '-'`" #so can check against file version in latest Woof.
   [ -f ${PATHPREFIX}/usr/share/sss/$SSSFILE/$SSSFILE ] && ASTAT="`stat --format=%y "${PATHPREFIX}/usr/share/sss/$SSSFILE/$SSSFILE" | cut -f 1 -d ' ' | tr -d '-' `" #get orig modify date.
   xASTAT1="`stat --format=%Y "/tmp/momanager/$SSSFILE.$ORIGLANG1"`" #seconds since epoch.
   LANG=${ORIGLANG} defaulttexteditor /tmp/momanager/$SSSFILE.$ORIGLANG1
   xASTAT2="`stat --format=%Y "/tmp/momanager/$SSSFILE.$ORIGLANG1"`" #seconds since epoch.
@@ -1091,10 +1078,11 @@
   dir2tgz MoManager-${ORIGLANG12}-${APKGNAME}/
   tarball_func
   export LANG=$ORIGLANG
   exec momanager reenter
  ;;
+
  edit_sss)
   APKGNAME="WOOF"
   SSSFILE="$YESSSS_COMBO" #ex: menu_strings.de (located at /usr/share/sss/menu_strings/)
   SSSFILE="`echo -n "$SSSFILE" | rev | cut -f 2-9 -d '.' | rev`" #dump the extension, ex: menu_strings.de -> menu_strings
   #cp -f /usr/share/sss/$SSSFILE/$SSSFILE.$ORIGLANG1 /tmp/momanager/$SSSFILE.$ORIGLANG1
@@ -1153,25 +1141,15 @@
     fi
     killall seamonkey 2>/dev/null
     killall seamonkey-bin 2>/dev/null
     killall geany 2>/dev/null
     [ ! -f "$SSS_TRANSLATION_FILE" ] && cp -a -f $TARGETFILE $SSS_TRANSLATION_FILE
-    echo '#!/bin/sh
-    sleep 3
-    yaf-splash -bg orange -placement top -timeout 9 -text "This is the original English file. Use this for reference only, do not edit. PLEASE WAIT..."
-    ' > /tmp/momanager/yafmsg5a
-    chmod 755 /tmp/momanager/yafmsg5a
-    /tmp/momanager/yafmsg5a & #msg has delay so will appear on top of text editor window.
+    poptop_func "This is the original English file. Use this for reference only, do not edit. PLEASE WAIT..." orange
     LANG=${ORIGLANG} ${SSS_HANDLER_VIEWER} "$TARGETFILE" &
     dPID=$!
     sleep 10
-    echo '#!/bin/sh
-    sleep 4
-    yaf-splash -bg yellow -placement top -timeout 11 -text "You must translate all of the text in this file to '${ORIGLANG1}' language. Edit, then Save, then Quit. Note, if you do not want to change anything, just Quit the editor..."
-    ' > /tmp/momanager/yafmsg5b
-    chmod 755 /tmp/momanager/yafmsg5b
-    /tmp/momanager/yafmsg5b & #msg has delay so will appear on top of text editor window.
+    poptop_func "You must translate all of the text in this file to '${ORIGLANG1}' language. Edit, then Save, then Quit. Note, if you do not want to change anything, just Quit the editor..." yellow 11
     xASTAT1="`stat --format=%Y "$SSS_TRANSLATION_FILE"`" #seconds since epoch.
     LANG=${ORIGLANG} ${SSS_HANDLER_EDITOR} ${SSS_TRANSLATION_FILE}
     xASTAT2="`stat --format=%Y "$SSS_TRANSLATION_FILE"`" #seconds since epoch.
     kill $dPID
     [ "$xASTAT1" = "$xASTAT2" ] && continue
@@ -1244,16 +1222,11 @@
   done
   echo  >> /tmp/momanager/$SSSFILE.$ORIGLANG1
 
   sync
   killall geany 2>/dev/null
-  echo '#!/bin/sh
-  sleep 3
-  yaf-splash -bg yellow -placement top -timeout 9 -text "The SSS file is now open in a text editor. You must only edit between the last two % characters. Edit, then Save, then Quit text editor..."
-  ' > /tmp/momanager/yafmsg5
-  chmod 755 /tmp/momanager/yafmsg5
-  /tmp/momanager/yafmsg5 & #msg has delay so will appear on top of text editor window.
+  poptop_func "The SSS file is now open in a text editor. You must only edit between the last two % characters. Edit, then Save, then Quit text editor..."
   ASTAT="`stat --format=%y "/usr/share/sss/$SSSFILE/$SSSFILE.$ORIGLANG1" | cut -f 1 -d ' ' | tr -d '-'`" #so can check against file version in latest Woof.
   [ -f ${PATHPREFIX}/usr/share/sss/$SSSFILE/$SSSFILE.$ORIGLANG1 ] && ASTAT="`stat --format=%y "${PATHPREFIX}/usr/share/sss/$SSSFILE/$SSSFILE.$ORIGLANG1" | cut -f 1 -d ' ' | tr -d '-' `" #get orig modify date.
   xASTAT1="`stat --format=%Y "/tmp/momanager/$SSSFILE.$ORIGLANG1"`" #seconds since epoch.
   LANG=${ORIGLANG} defaulttexteditor /tmp/momanager/$SSSFILE.$ORIGLANG1
   xASTAT2="`stat --format=%Y "/tmp/momanager/$SSSFILE.$ORIGLANG1"`" #seconds since epoch.
@@ -1284,10 +1257,11 @@
   dir2tgz MoManager-${ORIGLANG12}-${APKGNAME}/
   tarball_func
   export LANG=$ORIGLANG
   exec momanager reenter
  ;;
+
  edit_xml|create_xml) #XML data files.
   if [ "$EXIT" = "edit_xml" ];then
    XMLFILE="`echo -n "$YESXML_COMBO" | cut -f 1 -d ' '`"
    APKGNAME="`echo -n "$YESXML_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ')'`"
   else
@@ -1294,16 +1268,11 @@
    XMLFILE="`echo -n "$NOXML_COMBO" | cut -f 1 -d ' '`"
    APKGNAME="`echo -n "$NOXML_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ')'`"
   fi
   sync
   killall geany 2>/dev/null
-  echo '#!/bin/sh
-  sleep 3
-  yaf-splash -bg yellow -placement top -timeout 9 -text "The XML file is now open in a text editor. Edit, then Save, then Quit text editor..."
-  ' > /tmp/momanager/yafmsg7
-  chmod 755 /tmp/momanager/yafmsg7
-  /tmp/momanager/yafmsg7 & #msg has delay so will appear on top of text editor window.
+  poptop_func "The XML file is now open in a text editor. Edit, then Save, then Quit text editor..."
   ASTAT="`stat --format=%y "$XMLFILE" | cut -f 1 -d ' ' | tr -d '-' `" #so can check against file version in latest Woof.
   [ -f "${PATHPREFIX}${XMLFILE}" ] && ASTAT="`stat --format=%y "${PATHPREFIX}${XMLFILE}" | cut -f 1 -d ' ' | tr -d '-' `" #get orig modify date.
   xASTAT1="`stat --format=%Y "${XMLFILE}"`" #seconds since epoch.
   LANG=${ORIGLANG} defaulttexteditor "${XMLFILE}"
   xASTAT2="`stat --format=%Y "${XMLFILE}"`" #seconds since epoch.
@@ -1323,10 +1292,11 @@
   dir2tgz MoManager-${ORIGLANG12}-${APKGNAME}/
   tarball_func
   export LANG=$ORIGLANG
   exec momanager reenter
  ;;
+
  edit_bin|create_bin) #binary executables.
   if [ "$EXIT" = "edit_bin" ];then
    ABIN="`echo -n "$YESBIN_COMBO" | cut -f 1 -d '(' | rev | cut -f 2-9 -d ' ' | rev`"
    ANAME="`basename "$ABIN"`"
    ATRANSLANG="`echo -n "$YESBIN_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ' '`" #ex: de
@@ -1354,42 +1324,63 @@
   esac
   AMOSPEC="${PREFIXLOCALEDIR}/${ATRANSLANG}/LC_MESSAGES/${AMO}"
   mkdir -p "${PREFIXLOCALEDIR}/${ATRANSLANG}/LC_MESSAGES" #120308
   cp -f /usr/share/doc/nls/${ATEXTDOMAIN}/${ATEXTDOMAIN}.pot /tmp/momanager/
   cd /tmp/momanager
-  ROPID=0
-  if [ "$EXIT" = "edit_bin" ];then
-   cp -f "$AMOSPEC" /tmp/momanager/${ATEXTDOMAIN}.moOLD
-   msgunfmt "$AMOSPEC" > /tmp/momanager/${ATEXTDOMAIN}1.po
-   #this syncs textdomain1.po and textdomain.pot, merges to textdomain.po ...
-   rm -f ${ATEXTDOMAIN}.po 2>/dev/null
-   LANG=${ORIGLANG} rxvt -e intltool-update --dist --gettext-package=${ATEXTDOMAIN} --output-file=${ATEXTDOMAIN}.po ${ATEXTDOMAIN}1
-   BINMSG="A mo file has been converted to an editable po file. Edit, then Save, then Quit text editor..."
-   #120308 intltool-update is broken with ROX-Filer.pot. need a fallback method...
-   if [ ! -s ${ATEXTDOMAIN}.po ];then
-    LANG=${ORIGLANG} rxvt -e msginit --no-wrap --locale=${ORIGLANG12} --output-file=${ATEXTDOMAIN}.po --input=${ATEXTDOMAIN}.pot #create po file without any translations.
-    LANG=${ORIGLANG} defaulttextviewer /tmp/momanager/${ATEXTDOMAIN}1.po & #warning, this must be different from defaulttexteditor!
-    ROPID=$!
-    BINMSG="BAD NEWS: the 'intltool-update' utility was unable to merge your existing translations with the pot file. Therefore, the translations are open in a separate file '${ATEXTDOMAIN}1.po' and you must paste them into '${ATEXTDOMAIN}.po' -- edit the latter only! Edit '${ATEXTDOMAIN}.po', save, then quit..."
-   fi
+  ROPID=0 ; POPCOL='yellow'
+  BINMSG="A po file is open for editing. Edit, then Save, then Quit text editor..."
+  if [ -f /usr/share/doc/nls/${ATEXTDOMAIN}/${ATRANSLANG}.po ];then #120309 use pre-existing po file.
+   cp -f /usr/share/doc/nls/${ATEXTDOMAIN}/${ATRANSLANG}.po ./${ATEXTDOMAIN}.po
+   BINMSG="A po file is open for editing. NOTE: this file was obtained from /usr/share/doc/nls/${ATEXTDOMAIN}/${ATRANSLANG}.po. Edit, then Save, then Quit text editor..."
+   [ -f "$AMOSPEC" ] && cp -f "$AMOSPEC" /tmp/momanager/${ATEXTDOMAIN}.moOLD
   else
-   LANG=${ORIGLANG} rxvt -e msginit --no-wrap --locale=${ORIGLANG12} --output-file=${ATEXTDOMAIN}.po --input=${ATEXTDOMAIN}.pot
-   BINMSG="A po file is open for editing. Edit, then Save, then Quit text editor..."
+   if [ "$EXIT" = "edit_bin" ];then
+    cp -f "$AMOSPEC" /tmp/momanager/${ATEXTDOMAIN}.moOLD
+    msgunfmt "$AMOSPEC" > /tmp/momanager/${ATEXTDOMAIN}1.po
+    #this syncs textdomain1.po and textdomain.pot, merges to textdomain.po ...
+    rm -f ${ATEXTDOMAIN}.po 2>/dev/null
+    LANG=${ORIGLANG} rxvt -e intltool-update --dist --gettext-package=${ATEXTDOMAIN} --output-file=${ATEXTDOMAIN}.po ${ATEXTDOMAIN}1
+    BINMSG="A mo file has been converted to an editable po file. Edit, then Save, then Quit text editor..."
+    #120308 intltool-update is broken with ROX-Filer.pot. need a fallback method...
+    if [ ! -s ${ATEXTDOMAIN}.po ];then
+     LANG=${ORIGLANG} rxvt -e msginit --no-wrap --locale=${ORIGLANG12} --output-file=${ATEXTDOMAIN}.po --input=${ATEXTDOMAIN}.pot #create po file without any translations.
+     LANG=${ORIGLANG} defaulttextviewer /tmp/momanager/${ATEXTDOMAIN}1.po & #warning, this must be different from defaulttexteditor!
+     ROPID=$!
+     BINMSG="BAD NEWS: the 'intltool-update' utility was unable to merge your existing translations with the pot file. Therefore, the translations are open in a separate file '${ATEXTDOMAIN}1.po' and you must paste them into '${ATEXTDOMAIN}.po' -- edit the latter only! Edit '${ATEXTDOMAIN}.po', save, then quit..."
+     POPCOL='LightPink'
+    fi
+   else
+    LANG=${ORIGLANG} rxvt -e msginit --no-wrap --locale=${ORIGLANG12} --output-file=${ATEXTDOMAIN}.po --input=${ATEXTDOMAIN}.pot
+   fi
   fi
   sync
-  poptop_func "$BINMSG"
+  poptop_func "$BINMSG" $POPCOL
+  zASTAT1="`stat --format=%Y /tmp/momanager/${ATEXTDOMAIN}.po`" #120309 modify date, seconds.
   if [ "$POEDITOR" ];then
    ${POEDITOR} /tmp/momanager/${ATEXTDOMAIN}.po
   else
    killall geany 2> /dev/null #otherwise geany will return immediately and continue executing this script.
    sleep 0.5
    LANG=${ORIGLANG} defaulttexteditor /tmp/momanager/${ATEXTDOMAIN}.po
   fi
   [ $ROPID -ne 0 ] && kill $ROPID
+  zASTAT2="`stat --format=%Y /tmp/momanager/${ATEXTDOMAIN}.po`" #120309 modify date.
+  if [ "$zASTAT1" = "$zASTAT2" ];then #120309
+   export LANG=$ORIGLANG
+   exec momanager reenter
+  fi
   LANG=${ORIGLANG} 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
+#  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
+  pupdialog --background yellow --colors --backtitle "MoManager: post-edit mo" --yes-label "OK" --no-label "Cancel" --extra-button --extra-label "OK, keep po" --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.
+
+WARNING: If there is an existing mo file, MoManager uncompiles it and merges with the pot file, to create the editable po file. However, sometimes this process fails (ROX-Filer for example). In such a case, you can click the \ZbOK, keep po\ZB button, which will retain the po file at \Zb/usr/share/doc/nls/${ATEXTDOMAIN}/${ATRANSLANG}.po\ZB, for use next time that you want to edit it with MoManager. Note, if uncertain, do not click this button." 0 0 #120309
+  RETVAL=$?
+  if [ $RETVAL -eq 3 ];then #extra button
+   cp -f /tmp/momanager/${ATEXTDOMAIN}.po /usr/share/doc/nls/${ATEXTDOMAIN}/${ATRANSLANG}.po
+   RETVAL=0
+  fi
+  if [ $RETVAL -eq 0 ];then
    cp -f /tmp/momanager/${ATEXTDOMAIN}.mo "${AMOSPEC}"
    #output as a tarball that user can email to pkg author...
    mkdir -p /root/MoManager-${ORIGLANG12}-${APKGNAME}${PREFIXLOCALEDIR}/${ATRANSLANG}/LC_MESSAGES
    cp -f /tmp/momanager/${ATEXTDOMAIN}.mo /root/MoManager-${ORIGLANG12}-${APKGNAME}${PREFIXLOCALEDIR}/${ATRANSLANG}/LC_MESSAGES/
    ASTAT="`stat --format=%y "$ABIN" | cut -f 1 -d ' ' | tr -d '-' `" #so can check against file version in latest Woof.
@@ -1403,10 +1394,11 @@
    pupdialog --background pink --backtitle "MoManager: mo edit aborted" --msgbox "You have declined to update the mo file." 0 0
   fi
   export LANG=$ORIGLANG
   exec momanager reenter
  ;;
+
  create_pet) #create a langpack PET
   mv -f /root/langpack_${GENLANG}-${ADATE}.pet /root/langpack_${GENLANG}-${ADATE}.petOLD 2>/dev/null
   [ -d /root/langpack_${GENLANG}-${ADATE} ] && rm -rf /root/langpack_${GENLANG}-${ADATE}
   mkdir /root/langpack_${GENLANG}-${ADATE}
   cp -a -f /usr/share/doc/langpack-template/* /root/langpack_${GENLANG}-${ADATE}/