bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 1.7.7: Localization does not follow the language of the OS


From: Bruno Haible
Subject: Re: 1.7.7: Localization does not follow the language of the OS
Date: Fri, 28 Jan 2011 21:58:54 +0100
User-agent: KMail/1.9.9

Replying to <http://www.cygwin.com/ml/cygwin/2011-01/msg00119.html>:

> I have a Dutch windows version, so
> on my PC the application should automatically set its language to Dutch.
> I want to release this application to users with different language
> preferences, and on their PCs the application should automatically adapt
> to their OS language settings.
> 
> I think that doing setlocale(LC_ALL, ""); on application initialization
> should do the trick.

Yes it does - assuming you use a libintl from gettext version >= 0.18,
and assuming that you have a #include <libintl.h> in the source file that
invokes setlocale (LC_ALL, "").

This was implemented in gettext 0.18. Citing the NEWS file:

  * Runtime behaviour:
    - On MacOS X and Windows systems, <libintl.h> now extends setlocale() and
      newlocale() so that their determination of the default locale considers
      the choice the user has made in the system control panels.

I don't know which gettext version is used in cygwin 1.7.7. You can look it
up through "grep LIBINTL_VERSION /usr/include/libintl.h".

But note that libintl provides only text message translation. Other locale
services, such as number formatting or collation, are implemented in libc.
For these please follow the documentation, cf.
  <http://www.cygwin.com/ml/cygwin/2011-01/msg00129.html>

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]