Glibc localization questions
pchllck at nexgo.de
Sat Oct 27 13:08:20 PDT 2001
[27.10.01 04:05 -0700] Nelson G. Arzola <-- :
> However, I have not figured out how the files in /usr/share/i18n and
> /usr/lib/locale are used.
> I'm trying to build an LFS system where the compiler and software
> development tools are located in a directory that can be mounted from a
> CD. In my case, I'm using /usr/swdev. I need to know if /usr/share/i18n
> and /usr/lib/locale are needed are compile-time, run-time, or both.
I hope you can deal with me answering maybe with different than the
normal book version directories, but I will try to give a key-file to
recognize. And forgive if I use some relax explanations.
/i18n is unique:
The /charmaps contain for every "officially defined" character set a map
which characters are known - like you specify you want iso-8859-1, then
you can expect that for example german diaraesis (some say umlauts) will
be known, because that map lists them.
It is "raw material" which localedef uses for building the LC_XXX files.
The /locales (note the "s" at the end) contain for every language (and
if we have to make more difference for every territory) some "standard
sets" of how things are done there - like you specify you want an
LC_MONETARY=it than be prepared that your money will have 3 digits for
the cents/pennies (if I remember correctly).
It is also "raw material" used by localedef command
Those two belong together, for every /locales/<language>_<territory>
you need the /charmaps/xx files which contain all valid charcaters used
with that <language>_<territory>. If you have for example only US maps
and try to use localedef for dk (Danmark) you are missing the danish
Fazit: /i18n is used by localedef to compile LC_XXX files. This is
done 1.) if you use the books 'make localedata/install-locales' which
is doing simply the localedef command on just everything which it can
find; 2.) if you only want to install some few LC_XXX files and
therefore run the localedef command instead of it; 3.) if you did the
second and later detect you are missing one and therefore run the
localedef command maybe 3 months later.
------ hoops, break
/lib/locale: contents subdirectories named <language>_<TERRITORY>
which are always 2small_2BIG letters. And the contents of the
subdirectories contain 11 LC_XXX files and 1 subdirectory LC_MESSAGES
which has a file SYS_LC_MESSAGES (how to tell yes/no if the system asks)
Those LC_XXX files are compiled data files which the above localedef
produced and which are then installed here. They are used if a user
puts for example LC_TIME=sv_SE to get the output of 'date' with
swedish days and not english. If one of the requested values is
missing (because you did no localedef command for that) it will fall
back to the default (which is C or POSIX and en_US).
Fazit: /locale is used during runtime if a special LC_XXX value has
been requested by a user
------ hoops, break
??/locale/: contents subdirectories named <language>
which is mostly 2small letters. And the contents is a subdirectory
called LC_MESSAGES which has maybe files called package.mo.
These package.mo files only exist if you --enable-nls during configure.
The files are compiled and installed here by gettext (in the book the
first one putting something here is glibc), so key-file is glibc.mo.
They are used if a user sets the LANG= or LANGUAGE= to the language for
which he wants translations. If the language is not available the
package will fall back to the default english (also if a sentence has
not been translated). Same if there is a translation file but the
package has no nls-ability (which you get with --enable-nls).
Fazit: ??/locale/<language>/yyy.mo are used during runtime if a language
has been requested by a user (and is available)
------ hoops, end
Hope with this you can best decide.
Erika Pacholleck <pchllck at nexgo.de> @@ -18,9 +18,12 @@ -p+pa -h+ho -c+ec
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message
More information about the blfs-support