Glibc locale files

Locale files define the culural conventions of a langauge and region. The Glibc
locale files are used on all GNU/Linux systems so are needed for software that
will run on Linux.

Data

Translate locale data files can be stored in CVS locale/localedata.  While these 
files are in development the reference version is the one contained there.  
When the files are suitably mature they are submitted to glibc and those 
become the reference versions while those located here will then contain 
any development work.

Tools

The following are tools located in the "Translate" locale/ CVS module.  They are 
useful for building and testing glibc locales:

missing - will determine if a locale file has a certain locale field or not.
error - will display any compilation errors detected
install - will perform a test install (use -r for a real install - must be root)
definition - will print the value of a locale field (installed locales only)
locale-escape - converts your locale into  format

check-dates - prints a list of the LC_TIME defined date formats for the locale

Editing

If you edit your locale using vim then make use of the fdcc file highlighter.
Newer version of vim should already have this file installed and will detect
the filetype automatically.

If not available you will need to get the file and follow the instructions here:
http://www.vim.org/scripts/script.php?script_id=917

Edit in normal UTF-8 and then use locale-escape to encode your work in the
 format used in glibc locale files.

Checking

For a quick check first install the locale as root run:

  install -r xx_XX

Then run checks, either

  definition xx_XX

Or

  definition -c LC_TIME xx_XX

And go through each one checking that the entries are correct

Defining LC_TIME

Use 'man date' to see what variables are valid in a locale file date and time formating.  
If you want to remove space padding then use minus in the variable eg: %-e will print the 
day of the week without a space padding before the number.  Eg '[space]1' becomes simply '1'


Resources

Probably the best source of information on glibc locale files:
http://www.student.uit.no/~pere/linux/glibc/

These are resource specific to the creation of glibc locales:

The ISO 14652 standard that defines locale of fdcc files:
http://anubis.dkuug.dk/jtc1/sc22/wg20/docs/n897-14652w25.pdf 
  (seems to be the latest version fo the standard)
http://anubis.dkuug.dk/jtc1/sc22/wg20/docs/n922-linux-14652.txt 
  (comments from Ulrich Drepper the creator of locale implementation in glibc)
http://anubis.dkuug.dk/jtc1/sc22/wg20/docs/n925-14652-keld.txt
  (Keld Simonsen's comments on Drepper's mail (Simonsen manages the ISO 14652 standard))

The following is a guide developed by the Lugandan locale creator:
http://www.kizito.uklinux.net/download/LocaleGuide.tar


Notes:

All changes to glibc locales must also be reflected into the IBM ICU 
locales. So you need to post 'bug' reports against ICU and possibly 
against the OO locales as well.

Submitting your new/update locale to glibc

Note double check everything before sending.  Its easy to overlook silly things
like comments that still apply to a previous language.  Check them all again.

Officially you should send your locale files to:
  http://www.gnu.org/software/libc/bugs.html or
  bug-glibc@gnu.org or 
  use glibcbug script which seems to email glibc-bug-reports-stable@gnu.org

However I have in the past sent email to the glibc maintainer:
  Ulrich Drepper the glibc maintainer at: drepper - redhat - com

Attach the file and preferably a diff between your update and the one in glibc
CVS

   diff -u xx_XX.glibc_version xx_XX.updated > xx_XX.diff

Make the subject very clear: "Update xx_XX glibc locale file"
Attach the files and send.