This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Replying to <>:

> 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.


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]