Translation status

Dimitrie O. Paun dimi at intelliware.ca
Thu Sep 18 13:12:34 CDT 2003


Hi folks,

Here is a little script that generates a table detailing
the i18n status. It works by comparing the last updated
timestamp from CVS of the language file with the master file.

It generates a matrix like this (hopefully it's not wrapped):

Legend:
  '.' -- translation appears to be uptodate
  'x' -- translation needs updating
  '?' -- unknown status (file not under CVS control)
  ' ' -- translation missing
Master language is En

  Module / Language       Ca Cn Cs Da De En Eo Es Fi Fr Hu It Ja Ko Nl No Pl Pt Ru Si Sk Sv Sw Va Wa Xx Zh
            dlls/avifil32             .  .     .           .                 .  .  .
            dlls/comctl32    .        .  .     .                 .        .  .  .  .
             dlls/commdlg .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .        .     .
     dlls/msvideo/msrle32             .  .     .     .                       .  .  .
            dlls/serialui                .                                      .
            dlls/setupapi                .                                      .
             dlls/shell32 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .        .     .
      dlls/user/resources .     .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .        .     .
              dlls/wineps             .  .     .     .           .           .  .  .  .
             dlls/wininet                .     .                             .  .  .
               dlls/winmm                .     .     .              .        .  .  .  .
           programs/clock          .  .  .     .  .  .  .  .                 .  .  .  .     .     .     .
        programs/cmdlgtst                .           .     .                 .  .  .
         programs/notepad          .  .  .     .  .  .  .  .                 .  .  .  .     .     .     .
         programs/progman          x  x  .     .  .  .  .  .     .           .  .  .  .     .  .  .  .  .
            programs/view                .     .     .     .                 .  .  .
            programs/wcmd                .           .                       .  .  .
     programs/wineconsole             .  .           .  .                    .  .                       .
        programs/winemine                .     .                             .  .  .
         programs/winhelp          .  .  .     .  .  .  .  .     .           .  .  .  .     .  .  .     .
         programs/regedit                .     .     .                       .  .  .
        programs/winefile             .  .           .  .                    .  .  .                    .
           programs/start                .                 .                 .  .  .
         programs/winecfg                .     x                             x  x  x
        programs/wineproc                ?


Run it, it's fun! :) I guess I will submit it to the tree.

-- 
Dimi.
-------------- next part --------------
#!/bin/sh

MASTER_LANG=En
MASTER_FILES=`find . -name "*$MASTER_LANG.rc"`

list_translations()
{
    MASTER_FILE=$1
    TRANSLATIONS=`ls ${MASTER_FILE%$MASTER_LANG.rc}??.rc`
    for translation in $TRANSLATIONS; do
        LANG=`echo "$translation" | sed 's/.*\(..\)\.rc/\1/'`
        if [ "$LANG" != 'xx' ]; then echo "$LANG"; fi
    done
}

seconds_since_epoch()
{
    FILE="$1"
    STATUS="`cvs status $FILE 2>/dev/null | grep 'Working revision:'`"
    if ! echo "$STATUS" | grep -q "No entry for"; then
        DATE="`echo "$STATUS" | sed 's/[^0-9]*[^ ]* *//'`"
        date -d "$DATE" '+%s'
    fi
}


echo "Legend:"
echo "  '.' -- translation appears to be uptodate"
echo "  'x' -- translation needs updating"
echo "  '?' -- unknown status (file not under CVS control)"
echo "  ' ' -- translation missing"
echo "Master language is $MASTER_LANG"
echo

ALL_LANGS=`(for file in $MASTER_FILES; do list_translations "$file"; done) | sort -u`

echo "  Module / Language      " $ALL_LANGS

for master in $MASTER_FILES; do
    MASTER_TIMESTAMP=`seconds_since_epoch "$master"`
    APP=`echo "${master%/*}" | sed 's/..//'`
    printf "%25s" "$APP"
    for lang in $ALL_LANGS; do
	LANG_FILE="${master%$MASTER_LANG.rc}$lang.rc"
	if [ -f "$LANG_FILE" ]; then
            if [ -z $MASTER_TIMESTAMP ]; then
	        STATUS="?"
	    else
	    	LANG_TIMESTAMP=`seconds_since_epoch "$LANG_FILE"`
	    	if [ "$LANG_TIMESTAMP" -lt "$MASTER_TIMESTAMP" ]; then
		    STATUS="x"
	    	else
		    STATUS="."
	    	fi
	    fi
	else
	    STATUS=" "
	fi
	echo -n " $STATUS "
    done
    echo
done


More information about the wine-devel mailing list