From: Corinna Vinschen on
Mihai N. wrote:
>> Is there an API which returns this sort of localized strings?
>
> No, there is no such thing.
> What Pavel recomended might work, but is not documented and not recomended.
> Might change in one year, or tomorrow.

Oh well, too bad.

Thanks all the same,
Corinna

--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
From: Liviu on
"Corinna Vinschen" <corinna(a)community.nospam> wrote...
>
> locale-specific strings with the meaning "Yes" or "No".

Maybe MessageBoxEx with MB_YESNO, then read the button texts
within a hook (and drop the "&"s). Looks like a lot of work for
something so simple, and may require the respective language pack to
be installed, but then there seems to be no obvious alternative.

Liviu







From: Pavel A. on
"Liviu" <lab2k1(a)gmail.c0m> wrote in message
news:ecZoPx4mKHA.1548(a)TK2MSFTNGP02.phx.gbl...
> "Corinna Vinschen" <corinna(a)community.nospam> wrote...
>>
>> locale-specific strings with the meaning "Yes" or "No".
>
> Maybe MessageBoxEx with MB_YESNO, then read the button texts
> within a hook (and drop the "&"s). Looks like a lot of work for

Yep. This is exactly how I found these strings in user32.dll :)
--pa

> something so simple, and may require the respective language pack to
> be installed, but then there seems to be no obvious alternative.
>
> Liviu


From: Liviu on
"Pavel A." <pavel_a(a)12fastmail34.fm> wrote...
> "Liviu" <lab2k1(a)gmail.c0m> wrote
>>
>> Maybe MessageBoxEx with MB_YESNO, then read the button texts
>> within a hook (and drop the "&"s).
>
> Yep. This is exactly how I found these strings in user32.dll :)

You must have done some additional debugging to trace the strings
back to the source ;-) Anyway, quoting from your other post...

>>> Look in string table resources of user32.dll.
>>> "&Yes" is id=805, "&No" is id=806 (on XP SP3, x86)
> [...]
> The plain one-language system has only one variant of these
> string resources

....confirmed here. FWIW on a brute force search in my us-en XP install
I found just one system file with both yes/no and (fr) oui/non strings.
That was msi.dll (part of windows installer), where "&Yes" is string #25
and "&No" #26. Both are localized in 36 other languages, even though no
MUIs are installed (as well as some other common strings like OK,
cancel, retry, ignore etc). To be very clear, I am not in any way
recommending that one actually used those strings, relied on them
even being there, or on the IDs staying the same between versions.

Liviu




From: Corinna Vinschen on
Liviu wrote:
> "Pavel A." <pavel_a(a)12fastmail34.fm> wrote...
>> "Liviu" <lab2k1(a)gmail.c0m> wrote
>>>
>>> Maybe MessageBoxEx with MB_YESNO, then read the button texts
>>> within a hook (and drop the "&"s).
>>
>> Yep. This is exactly how I found these strings in user32.dll :)
>
> You must have done some additional debugging to trace the strings
> back to the source ;-) Anyway, quoting from your other post...
>
>>>> Look in string table resources of user32.dll.
>>>> "&Yes" is id=805, "&No" is id=806 (on XP SP3, x86)
>> [...]
>> The plain one-language system has only one variant of these
>> string resources
>
> ...confirmed here. FWIW on a brute force search in my us-en XP install
> I found just one system file with both yes/no and (fr) oui/non strings.
> That was msi.dll (part of windows installer), where "&Yes" is string #25
> and "&No" #26. Both are localized in 36 other languages, even though no
> MUIs are installed (as well as some other common strings like OK,
> cancel, retry, ignore etc). To be very clear, I am not in any way
> recommending that one actually used those strings, relied on them
> even being there, or on the IDs staying the same between versions.

That doesn't exactly look like the way to go. I'm looking for system
info in the style of GetLocaleInfo(Ex), which can be asked for on the
fly, independently of the system. The information given there is
usually available for all supported locales, whether or not the
languages are installed as GUI languages. Stuff like calling MessageBoxEx
is also not quite what I had in mind, given that I need the info in a
DLL which is usually running in CLI mode. Depending on the resource
number of a DLL which could change from system to system sounds a bit...
fragile.

Last but not least I actually need four strings, two with the localized
default string for "Yes" and "No", and two with regular expressions
containing the localized pattern to recognize user input meaning "Yes"
and "No". For the English language for instance: "^[yY]" and "^[nN]".

In case you're wondering what this is about, I'm searching the information
for the POSIX localization categories LC_COLLATE, LC_CTYPE, LC_MESSAGES,
LC_MONETARY, LC_NUMERIC, and LC_TIME. I can fetch all information via the
Win32 API, except for the aforementioned four strings which constitute the
minimal information given in the LC_MESSAGES category.

Well, looks like I have to create a file-based solution with the
information fetched from some other source.


Corinna

--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat