This is the mail archive of the cygwin-patches 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]

Add locale.exe option for querying Windows UI languages


The attached patch adds a --interface/-i option to locale.exe that
makes the --system/-s and --user/-u options print the respective
default UI language instead of the default locale.

	* locale.cc: Add --interface option for printing Windows default UI
	languages.

For background, here's what Windows' various default locales and languages do:

- LOCALE_USER_DEFAULT: This reflects the setting on the Formats tab of
the (Windows 7) Region&Language control panel, which affects the
format of times, dates, numbers, and currency.

- LOCALE_SYSTEM_DEFAULT: This reflects the "Language for non-Unicode
programs" on the Adminstrative tab of Region&Language control panel,
which also determines the ANSI and OEM codepages.

- GetUserDefaultUILanguage(): This is the current user's Windows UI
language, also called display language. On Windows installs with
multiple UI languages, a setting for this appears on the "Keyboards
and Languages" tab of the Region&Language control panel.

- GetSystemDefaultUILanguage(): The is the system-wide UI language
used for things that aren't user-specific, e.g. the login screen. As
far as I know it's determined at Windows install time and can''t be
changed.

(The latter two APIs are available from Windows 2000 onwards.)

Looking at those, and if we wanted to base the Cygwin locale settings
on the Windows ones, I think LC_NUMERIC, LC_TIME, and LC_MONETARY
should be determined by LOCALE_USER_DEFAULT, but LC_MESSAGES should be
determined by GetUserDefaultUILanguage(). Not sure about LC_CTYPE and
LC_COLLATE, but I suppose it would make sense for character
classification and sorting to match the UI language.

See also this blog post by MS's "Dr International" Michael Kaplan:
http://blogs.msdn.com/b/michkap/archive/2006/05/13/596971.aspx

Andy

Attachment: ui_lang.patch
Description: Binary data


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