LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Where there are three different locale directories (https://www.linuxquestions.org/questions/slackware-14/where-there-are-three-different-locale-directories-4175476863/)

narke 09-12-2013 08:56 AM

Where there are three different locale directories
 
Hi,

Where there exists three different directories holding locale data? They are /usr/lib/locale, /usr/share/locale and /usr/share/X11/locale in my system. What is for what?

Thanks in advance.

Sorry for a typo: where -> why.

pan64 09-12-2013 10:19 AM

I would say partially historical reason. Also X11 uses its own settings, that is the last one (the others mainly for console). But probably their usage are mixed a bit, because the original goal of them is lost...
But I'm unsure, maybe there is a much more precise answer.

gnashley 09-12-2013 12:36 PM

/usr/lib/locale is where glibc puts the system locales. /usr/share/locale is where programs put them -except for X stuff as noted above.

Didier Spaier 09-12-2013 02:31 PM

In Linux, locale definitions (provided by glibc and glibc-i18n packages in Slackware), are customarily stored in /usr/lib/locale.

In /usr/share/locale you will find mostly <locale>/LC_MESSAGES subdirectories, that host files ending in .mo. These files are translations of application messages in the given locale, in the Machine Object (MO) format defined by gettext here. /usr/share/locale is the default location for these files.

See also Internationalization variables in the POSIX specification and Locale Environment Variables in gettext's manual.

Long story short: to translate messages of an application in a given language you need a proper MO file in /usr/share/locale/<locale>/LC_MESSAGES *and* locale definitions in /usr/lib/locale.

narke 09-14-2013 10:38 AM

Didier,

thanks. you well explained that /usr/lib/locale is for locale definition and /usr/share/locale is for locale data (MOs, etc). I think I understood the point. But you don't talk about /usr/share/X11/locale, where the files looks quite different.

Didier Spaier 09-14-2013 12:13 PM

Quote:

Originally Posted by narke (Post 5027629)
But you don't talk about /usr/share/X11/locale, where the files looks quite different.

These files mainly register X client mappings for multi-key input sequences (using sequences of key strokes that are combined to enter a single character). The mappings depend on the locale used, hence the need of these files.

To know more:
Code:

man XCompose


All times are GMT -5. The time now is 08:14 AM.