delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/01/28/15:59:50

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: sourceware.org
X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRbfA44+iwyQ==
X-RZG-CLASS-ID: mo00
From: Bruno Haible <bruno AT clisp DOT org>
To: cygwin AT cygwin DOT com, bug-gnu-gettext AT gnu DOT org
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
Cc: cornwarecjp AT lavabit DOT com
MIME-Version: 1.0
Message-Id: <201101282158.55782.bruno@clisp.org>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019