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 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201101282158.55782.bruno@clisp.org> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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 : > 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 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, 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. 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