[GRASS-dev] g.mlist, g.mremove fails in non-English locale

Glynn Clements glynn at gclements.plus.com
Sun Apr 6 18:24:40 EDT 2008


Maciej Sieczka wrote:

> $ locale
> LANG=pl_PL.UTF-8
> LC_CTYPE="pl_PL.UTF-8"
> LC_NUMERIC="pl_PL.UTF-8"
> LC_TIME="pl_PL.UTF-8"
> LC_COLLATE="pl_PL.UTF-8"
> LC_MONETARY="pl_PL.UTF-8"
> LC_MESSAGES="pl_PL.UTF-8"
> LC_PAPER="pl_PL.UTF-8"
> LC_NAME="pl_PL.UTF-8"
> LC_ADDRESS="pl_PL.UTF-8"
> LC_TELEPHONE="pl_PL.UTF-8"
> LC_MEASUREMENT="pl_PL.UTF-8"
> LC_IDENTIFICATION="pl_PL.UTF-8"
> LC_ALL=
> 
>   In this locale g.mlist is broken. Eg. the command:
> 
> g.mlist rast pat=* sep=,
> 
>   prints the following:
> 
> dostępnych,mapsecie,N51E015.hgt,N51E016.hgt,<PERMANENT>:,plików,raster,w
> 
>   instead of only:
> 
> N51E015.hgt,N51E016.hgt
> 
> This also breaks g.mremove in turn.
> 
> It looks that the Polish translation "raster plików dostępnych w 
> mapsecie <PERMANENT>:", used in g.list, gets mixed into g.mlist output. 
> What's wrong?

What's wrong is a matter of perspective.

In the immediate sense, the problem is that g.mlist removes the header
lines with:

	| grep -vE '^-+$|files available' \

which doesn't allow for NLS. Checking for e.g. ">:$" would probably be
better (although technically both > and : are legal in map names, it
seems unlikely to occur in practice).

In a more general sense, the problem is that modules which output
information in machine-readable form are somewhat scarce compared to
modules which output in human-readable form.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list