Check-in [6486b73f7e]
Not logged in

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

Overview

SHA1 Hash:6486b73f7ee0dacb4a66418ade8401ae481b0457
Date: 2012-07-31 14:49:08
User: BarryK
Comment:MoManager: multiple scripts can have same TEXTDOMAIN, auto use of pre-existing .pot file

Tags And Properties
Changes

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

@@ -32,10 +32,13 @@
 #120313 langpack pet help msg improved.
 #120313 langpack pet: offer to find more po, mo, pot and t12s translations.
 #120316 scoop up more translations. 120317 L18L: add man pages.
 #120216 small mod. to a message.
 #120729 L18L: problem gettext'ing zigbert's apps, which have a lot of scripts, but would like to combine into one .pot file.
+#120731 revert 120729.
+#120731 any script can have a pre-existing .pot file in /usr/share/doc/nls, it will automatically be used instead of generating a .pot file.
+#120731 multiple scripts can have the same TEXTDOMAIN. these scripts can be anywhere. a single .pot will be created/edited.
 
 #***MOMANAGER IS ENGLISH ONLY (NOT GETTEXT'ED)***
 #it is for use by developers/translators with knowledge of english.
 
 PARAM1=""
@@ -137,10 +140,11 @@
 #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'`"
+ #120731 what if code is: export TEXTDOMAIN='abc' or export TEXTDOMAIN="abc" remove the quotes... NO, not allowed to have quotes!!!!
  TEXTDOMAINVALUE="`grep '^export TEXTDOMAIN=' "$xAGTS" | head -n 1 | cut -f 2 -d '=' | tr '\t' ' ' | cut -f 1 -d ' '`" #1202120 need 'head -n1' ex: /usr/local/petget/ui_Classic has export TEXTDOMAIN in two places.
 
  #want to know if from Woof or a builtin pkg or later-installed pkg...
  BASExAGTS="`basename "$xAGTS"`"
  xPTN=" ${BASExAGTS}$"
@@ -721,10 +725,11 @@
 tarball_func() {
 TARBALLMSG="Translation files that you have created with MoManager have been copied into folder \Zb/root/MoManager-${ORIGLANG12}-${APKGNAME}\ZB, and a tarball has been created, \Zb/root/MoManager-${ORIGLANG12}-${APKGNAME}.tar.gz\ZB. Note, it contains \Zbwrite.log\ZB which records the details of each translation file.
 
 The tarball can be sent to whoever is the author/maintainer of the \Zb${APKGNAME}\ZB package, however, we recommend that they be sent to the maintainer of the \Zb${ORIGLANG1} langpack\ZB PET package. At the time of writing this, these are some maintainers:
 \Zbde\ZB L18L
+\Zbes\ZB vicmz
 \Zbfr\ZB esmourguit
 \Zbru\ZB rodin.s
 ...these people can be contacted via the Puppy Linux Forum.
 
 If there is no maintainer for a langpack for \Zb${ORIGLANG1}\ZB, then the invitation is extended to volunteer. You will notice the \ZbPET\ZB button on the main window -- a very easy way to create a PET package of all of the translations. Maintainers may also throw in any other relevant translations that they can find, even dictionary files, but not any binary executables as the PET has to be architecture-independent. When you have it working nicely, send it to me \ZbBarryK\ZB via the Puppy Forum."
@@ -749,17 +754,44 @@
    alsaconf)
     #rodin.s: xgettext does not work properly on alsaconf script, use ready-made alsaconf.pot (in Woof).
     cp -f /usr/share/doc/nls/alsaconf/alsaconf.pot ./
    ;;
    *)
-    cp -f "$ASCRIPT" ${ANAME}.sh #hack
-    #LANG=${ORIGLANG} rxvt -e xgettext --no-wrap -o ${ATEXTDOMAIN}.pot ${ANAME}.sh
-    #120729 L18L: problem gettext'ing zigbert's apps, which have a lot of scripts, but would like to combine into one .pot file.
-    # ex: pprocess has 'process', 'box_ok' and 'func'. pprocess has this line:
-    # export TEXTDOMAIN=pprocess # box_ok func
-    # ...the extra scripts are appended as comments. solution coded:
-    LANG=${ORIGLANG} rxvt -e xgettext --no-wrap -o ${ATEXTDOMAIN}.pot ${ANAME}.sh `grep 'export TEXTDOMAIN=' "${ASCRIPT}" | cut -d '#' -f2`
+    #120731 why not generalize the above. any script(s) can have a pre-existing .pot file and it will be used...
+    if [ -f /usr/share/doc/nls/${ATEXTDOMAIN}/${ATEXTDOMAIN}.pot ];then
+     cp -f /usr/share/doc/nls/${ATEXTDOMAIN}/${ATEXTDOMAIN}.pot ./
+    else
+#     ALREADYSH="$(echo -n "$ANAME" | grep '\.sh$')" #120731
+#     if [ "$ALREADYSH" = "" ];then
+#      cp -f "$ASCRIPT" ${ANAME}.sh #hack
+#      xANAME="${ANAME}.sh"
+#     else
+#      cp -f "$ASCRIPT" ${ANAME}
+#      xANAME="$ANAME"
+#     fi
+     #120731 multiple scripts may have the same TEXTDOMAIN...
+     tdPTN="^export TEXTDOMAIN=${ATEXTDOMAIN}"
+     #EXTRASCRIPTS="$(echo "${GETTEXTSCRIPTS}" | tr ' ' '\n' | xargs -I INPUTFILE grep --files-with-matches -w "${tdPTN}" INPUTFILE | sed -e 's%SPACECHAR% %g' | grep -v -x "${ASCRIPT}")"
+     #no, i will drop the $ANAME from above, and put them all in consistent order...
+     EXTRASCRIPTS="$(echo "${GETTEXTSCRIPTS}" | tr ' ' '\n' | xargs -I INPUTFILE grep --files-with-matches -w "${tdPTN}" INPUTFILE | sed -e 's%SPACECHAR% %g')"
+     if [ "$EXTRASCRIPTS" ];then
+      echo -n "" > ./xEXTRASCRIPTS
+      echo "$EXTRASCRIPTS" |
+      while read ONEEXTRA
+      do
+       [ "$ONEEXTRA" = "" ] && continue
+       [ ! -f "$ONEEXTRA" ] && continue #precaution.
+       ONEBASE="$(basename "${ONEEXTRA}" .sh)"
+       cp -f "$ONEEXTRA" ./${ONEBASE}.sh
+       echo "${ONEBASE}.sh" >> ./xEXTRASCRIPTS
+      done
+      #LANG=${ORIGLANG} rxvt -e xgettext -o ${ATEXTDOMAIN}.pot --no-wrap ${xANAME} `cat ./xEXTRASCRIPTS`
+      LANG=${ORIGLANG} rxvt -e xgettext -o ${ATEXTDOMAIN}.pot --no-wrap `cat ./xEXTRASCRIPTS`
+#     else  #previous code...
+#      LANG=${ORIGLANG} rxvt -e xgettext --no-wrap -o ${ATEXTDOMAIN}.pot ${xANAME}
+     fi
+    fi
    ;;
   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
@@ -823,24 +855,56 @@
 #  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
+#  ALREADYSH="$(echo -n "$ANAME" | grep '\.sh$')" #120731
+#  if [ "$ALREADYSH" = "" ];then
+#   cp -f "$ASCRIPT" ${ANAME}.sh #hack, i think the .sh helps xgettext.
+#   xANAME="${ANAME}.sh"
+#  else
+#   cp -f "$ASCRIPT" ${ANAME}
+#   xANAME="$ANAME"
+#  fi
   case $ATEXTDOMAIN in
    alsaconf)
     #rodin.s: xgettext does not work properly on alsaconf script, use ready-made alsaconf.pot (in Woof).
     cp -f /usr/share/doc/nls/alsaconf/alsaconf.pot ./
    ;;
    *)
-    LANG=${ORIGLANG} 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%"
-    #dPTN="s%Content-Type: text/plain; charset=ASCII%Content-Type: text/plain; charset=UTF-8%"
-    sed -i -e "$aPTN" -e "$bPTN" -e "$cPTN" ${ATEXTDOMAIN}.pot
+    #120731 why not generalize the above. any script(s) can have a pre-existing .pot file and it will be used...
+    if [ -f /usr/share/doc/nls/${ATEXTDOMAIN}/${ATEXTDOMAIN}.pot ];then
+     cp -f /usr/share/doc/nls/${ATEXTDOMAIN}/${ATEXTDOMAIN}.pot ./
+    else
+     #120731 multiple scripts may have the same TEXTDOMAIN...
+     tdPTN="^export TEXTDOMAIN=${ATEXTDOMAIN}"
+     #EXTRASCRIPTS="$(echo "${GETTEXTSCRIPTS}" | tr ' ' '\n' | xargs -I INPUTFILE grep --files-with-matches -w "${tdPTN}" INPUTFILE | sed -e 's%SPACECHAR% %g' | grep -v -x "${ASCRIPT}")"
+     #no, i will drop the $ANAME from above, and put them all in consistent order...
+     EXTRASCRIPTS="$(echo "${GETTEXTSCRIPTS}" | tr ' ' '\n' | xargs -I INPUTFILE grep --files-with-matches -w "${tdPTN}" INPUTFILE | sed -e 's%SPACECHAR% %g')"
+     if [ "$EXTRASCRIPTS" ];then
+      echo -n "" > ./xEXTRASCRIPTS
+      echo "$EXTRASCRIPTS" |
+      while read ONEEXTRA
+      do
+       [ "$ONEEXTRA" = "" ] && continue
+       [ ! -f "$ONEEXTRA" ] && continue #precaution.
+       ONEBASE="$(basename "${ONEEXTRA}" .sh)"
+       cp -f "$ONEEXTRA" ./${ONEBASE}.sh
+       echo "${ONEBASE}.sh" >> ./xEXTRASCRIPTS
+      done
+      #LANG=${ORIGLANG} rxvt -e xgettext -o ${ATEXTDOMAIN}.pot --no-wrap ${xANAME} `cat ./xEXTRASCRIPTS`
+      LANG=${ORIGLANG} rxvt -e xgettext -o ${ATEXTDOMAIN}.pot --no-wrap `cat ./xEXTRASCRIPTS`
+#     else  #previous code...
+#      LANG=${ORIGLANG} rxvt -e xgettext -o ${ATEXTDOMAIN}.pot --no-wrap ${xANAME}
+      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%"
+      #dPTN="s%Content-Type: text/plain; charset=ASCII%Content-Type: text/plain; charset=UTF-8%"
+      sed -i -e "$aPTN" -e "$bPTN" -e "$cPTN" ${ATEXTDOMAIN}.pot
+     fi
+    fi
    ;;
   esac
   LANG=${ORIGLANG} rxvt -e msginit --no-wrap --locale=${ORIGLANG12} --output-file=${ATEXTDOMAIN}.po --input=${ATEXTDOMAIN}.pot
   sync
   poptop_func "The translation file is now open in a text editor. Edit, then Save, then Quit text editor..."

Changes to woof-distro/x86/Packages-puppy-wary5-official

@@ -200,12 +200,12 @@
 faad2-2.7-w5c|faad2|2.7-w5c||BuildingBlock|284K||faad2-2.7-w5c.pet||An MPEG4 AAC decoder|puppy|wary5||
 faad2_DEV-2.7-w5c|faad2_DEV|2.7-w5c||BuildingBlock|356K||faad2_DEV-2.7-w5c.pet|+faad2|An MPEG4 AAC decoder|puppy|wary5||
 faad2_DOC-2.7-w5c|faad2_DOC|2.7-w5c||BuildingBlock|24K||faad2_DOC-2.7-w5c.pet||An MPEG4 AAC decoder|puppy|wary5||
 fbset-2.1-w5c|fbset|2.1-w5c||Utility|40K||fbset-2.1-w5c.pet||A utility to show or change the settings of the frame buffer|puppy|wary5||
 fbset_DOC-2.1-w5c|fbset_DOC|2.1-w5c||Utility|40K||fbset_DOC-2.1-w5c.pet||A utility to show or change the settings of the frame buffer|puppy|wary5||
-ffmpeg-20111002-w5c|ffmpeg|20111002-w5c||BuildingBlock|5464K||ffmpeg-20111002-w5c.pet|+libvpx,+opencore-amr,+freetype,+libogg,+libvorbis,+lame,+faac,+speex,+x264,+libdc1394,+libtheora,+xvidcore,+schroedinger|multimedia player and converter and libraries|puppy|wary5||
-ffmpeg_DEV-20111002-w5c|ffmpeg_DEV|20111002-w5c||BuildingBlock|6800K||ffmpeg_DEV-20111002-w5c.pet|+ffmpeg|multimedia player converter and libraries|puppy|wary5||
+ffmpeg-0.8.12-1-w5c|ffmpeg|0.8.12-1-w5c||Multimedia|4768K||ffmpeg-0.8.12-1-w5c.pet|+libcdio,+libvpx,+opencore-amr,+freetype,+libogg,+libvorbis,+lame,+faac,+speex,+x264,+libdc1394,+libtheora,+xvidcore,+schroedinger|multimedia player and converter and libraries, supports x11grab and networking, compiled by shinobar|puppy|wary5||
+ffmpeg_DEV-0.8.12-1-w5c|ffmpeg_DEV|0.8.12-1-w5c||Multimedia|6644K||ffmpeg_DEV-0.8.12-1-w5c.pet|+ffmpeg|multimedia player and converter and libraries|puppy|wary5||
 fget-0.4.1-w5c|fget|0.4.1-w5c||Internet|44K||fget-0.4.1-w5c.pet|+dietlibc|A minimal httpftp download tool for boot disks|puppy|wary5||
 file-5.03-w5c|file|5.03-w5c||BuildingBlock|1896K||file-5.03-w5c.pet||File type identification utility|puppy|wary5||
 file_DOC-5.03-w5c|file_DOC|5.03-w5c||BuildingBlock|72K||file_DOC-5.03-w5c.pet||File type identification utility|puppy|wary5||
 findutils-4.4.2-w5c|findutils|4.4.2-w5c||BuildingBlock|152K||findutils-4.4.2-w5c.pet||GNU find utils|puppy|wary5||
 findutils_DOC-4.4.2-w5c|findutils_DOC|4.4.2-w5c||BuildingBlock|508K||findutils_DOC-4.4.2-w5c.pet||GNU find utils|puppy|wary5||