LC_MESSAGES implementation

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Feb 8 12:42:00 GMT 2010


On Feb  8 11:30, Corinna Vinschen wrote:
> Hi guys,
> 
> 
> I have finally found a method to implement the locale-specific
> LC_MESSAGES info.
> 
> Basically, I have two application which generate the yesexpr, noexpr,
> yesstr and nostr strings from foreign local data.  The first application
> is finished and generates the data from GLIBC locale data.  The second
> application is almost finished and generates the data from the CLDR
> project (http://cldr.unicode.org) locale data.
> 
> In both cases the data is generated as a header file containing a big
> array like this:
> 
> truct lc_msg_t
> {
>   const char    *locale;
>   const wchar_t *yesexpr;
>   const wchar_t *noexpr;
>   const wchar_t *yesstr;
>   const wchar_t *nostr;
> };
> 
> static struct lc_msg_t lc_msg[] =
> {
>   { "aa_DJ", L"\x005e\x005b\x006f\x004f\x0079\x0059\x005d\x002e\x002a", L"\x005e\x005b\x006d\x006e\x004d\x004e\x005d\x002e\x002a", L"", L"" },
>   [...]
> };
> 
> The subsequent code called from newlib's loadlocale() function fetches
> the locale data from this array using bsearch() with the key being the
> locale, and converts it into the correct charset.
> 
> Here are two questions:
> 
> - First of all, I'm not sure if I should use the GLIBC or the CLDR data.

I just re-examined the licensing of the GLIBC locale data and it turns
out that not *all* locale files have a free enough license to be used
by Cygwin.  Some have no licenses at all, some are explicitely under GPL.
Only 166 out of 266 locales are usable without licensing problems.

Other than that, here are the sources to generate the locale data,
as well as the generated files: http://www.vinschen.de/localedata/,
for those who are interested in this stuff.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-developers mailing list