Tech Support > Operating Systems > Linux / Variants > units locale
units locale
Posted by A. S. Budden on November 20th, 2003


Hi there,

I was just using units and I noticed that it uses the pint as being the
American pint, rather than the English one. I had a trawl through the
database and found the bit at the end of this email, which implies that
it chooses the type of pint according to the locale. However, the
output of locale on my computer is this:


LANG=en_GB
LC_CTYPE="en_GB"
LC_NUMERIC="en_GB"
LC_TIME="en_GB"
LC_COLLATE="en_GB"
LC_MONETARY="en_GB"
LC_MESSAGES="en_GB"
LC_PAPER="en_GB"
LC_NAME="en_GB"
LC_ADDRESS="en_GB"
LC_TELEPHONE="en_GB"
LC_MEASUREMENT="en_GB"
LC_IDENTIFICATION="en_GB"
LC_ALL=

Which should imply that it would choose the English definitions rather
than the American ones. I've got round the problem by copying the
units.dat to my home directory, ditching the locale bit and leaving just
the bit inside the en_GB section and then aliasing units -f
~/.units.dat, but it seems a bit of a bodge.

Is there a better way to sort this out?

Many thanks in advance,

Al

P.S. If it makes a difference, I'm using Mandrake 9.2 and units
--version gives:
units version 1.80 with readline, units database in /usr/share/units.dat


#
# Localisation
#

!locale en_US
hundredweight ushundredweight
ton uston
scruple apscruple
fluidounce usfluidounce
gallon usgallon
bushel usbushel
quarter quarterweight
cup uscup
tablespoon ustablespoon
teaspoon usteaspoon
horsepower ushorsepower
dollar US$
cent $ 0.01
penny cent
minim minimvolume
pony ponyvolume
firkin usfirkin
!endlocale

!locale en_GB
hundredweight brhundredweight
ton brton
scruple brscruple
fluidounce brfluidounce
gallon brgallon
bushel brbushel
quarter brquarter
chaldron brchaldron
cup brcup
teacup brteacup
tablespoon brtablespoon
teaspoon brteaspoon
horsepower brhorsepower
dollar US$
cent $ 0.01
penny brpenny
minim minimnote
pony brpony
firkin brfirkin


Similar Posts