Jean-Marc Lasgouttes wrote:
> Angus> Ok, Jean-Marc. The attached patch (to postats.sh only) produces
> Angus> http://www.devel.lyx.org/~leeming/www-devel/i18n.php3 when run
> Angus> as sh ./postats.sh *.po > i18n.php3
> 
> I am not sure I understand those lines:
> +     # Does $translator contain 8-bit characters?
> +     TAB='   '
> +     echo $translator | grep "[^${TAB} -~]" >/dev/null && {

There's no point calling recode if $translator contains only 7-bit
characters.

(the grep command matches anything that's not a tab and lies outside the
range <space> to <tilde>. See, eg, http://www.lookuptables.com/ .)

> And also these:
> +             # The ampersands in the $translator entries will mess things
> +             # up unless we escape 'em.
> +             translator=`echo $translator | sed 's/&/\\\&/g'`

We go on to use $translator on the right hand side of a sed script:
    s/AUTHOR/$translator/; s/EMAIL/$email/; s/DATE/$date/"`

sed will interpret this command:
    s/AUTHOR/Bj&oslash;nnes/
to output
    BjAUTHORoslash;nnes

(Incidentally, these spaces between ;-delimited commands will break Solaris
sed.)

> Angus> I guess this is exactly what we're looking for, no?
> Yep.

Ok to commit it then?

-- 
Angus

Reply via email to