Angus Leeming <[EMAIL PROTECTED]> writes:
> Ok, the script below works for me with
> $ awk -v top_srcdir='.' -f trial.awk \
>   ./src/frontends/qt3/ui/QPrefDisplayModule.ui

Jean-Marc, has this one slipped by your radar? I thought you wanted to remove 
this line noise from the .po files?

Angus

function fixupfilename()
{
    return substr(FILENAME, length(top_srcdir "/") + 1);
}
BEGIN {
    previousline="";
}
{
    # Filter out the captions as they just clutter the .po files.
    if (!(previousline ~ /^ *< *property  *name *= *"caption" *> *$/)) {
        if ($0 ~ /<string>/) {          
            line=$0;            
            sub(/.*<string>/, "", line);
            sub(/<\/string>.*/, "", line);
            gsub(/&amp;/, "\\&", line);
            gsub(/&lt;/, "<", line);
            gsub(/&gt;/, ">", line);
            gsub(/"/, "\\\"", line);
            if (length(line) > 0) {
                printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n",
                       fixupfilename(), FNR, line);
            }
        }
    }
    previousline=$0;
}


Reply via email to