Skip to Content.
Sympa Menu

freetds - Re: [freetds] How to set locales.conf in spanish

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] How to set locales.conf in spanish
  • Date: Fri, 10 Jan 2003 11:36:45 -0500

On Thu, 9 Jan 2003 21:42:09 -0800 (PST), Aliet Santiesteban Sifontes
<alietss AT yahoo.com> wrote:
> I'm trying to configure my
> locales.conf to be spanish rather english, so I can
> use the spanish language, anybody could tell me what
> do I have to do??

Aliet,

Thank you for asking that question. I've been meaning to redo that page
in the User Guide, and, as a matter of fact, I think we need to redo some
of the code, too.

locales.conf is not intended to be customized; it is a read-only data file
associating national conventions with server settings. It is incomplete
(in fact it's barely begun), and additions are welcome.

FreeTDS reads the LANG environment variable, and uses it as a key into
locales.conf. It expects a 5-character value in $LANG: 2 (lowercase) for
the language, an underscore, and 2 (uppercase) for the country. The
domain of values for language and country is governed by ISO standards.

Language codes (ISO 639:1988, now 639-1) are online at
http://www.loc.gov/standards/iso639-2/langhome.html

Country codes (ISO 3166) are online at
http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html

For Spanish in Spain, LANG=es_ES.

FreeTDS inspects locales.conf for a section matching $LANG, looking for
settings for the date format, language, and character set.

The date format string, as the UG says, is used by strftime(3). Set it in
accordance with your country's standard representation. (Your personal
preference, if different, would be reflected in freetds.conf, which will
override the locales.conf setting.)

The language, and character set are sent to the server; their domains are
defined by the vendors.

The language value is sent to the server at login time. It determines
what language your messages will be in. It does not affect collation.

The character set is sent to Sybase servers (and to Microsoft servers, if
using TDS 4.2). It determines what character set your data will be
encoded with when sent to the client.

Putting it all together, I'd expect a section like this:

[es_ES]
date format = %b %d %Y %I:%M%p
language = spanish
char set = iso_1

I just added that to the version of locales.conf in CVS. Please correct
it if it's not suitable, and tell us.

+++

I said that the value of LANG was controlled by ISO standards. That's not
quite true. It *should* be controlled that way, but some OS vendors use
different values. We have no way to cope with that except by adding
sections to locales.conf for every conceivable key. Also, the
setlocale(3) function is standardized by ANSI, so we should use that
instead of reading the LANG variable directly.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page