From: Liviu on
"Corinna Vinschen" <corinna(a)community.nospam> wrote...
> Liviu wrote:
>>>> Maybe MessageBoxEx with MB_YESNO, then read the button
>>>> texts within a hook (and drop the "&"s).
>
> 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.

The user would not need to ever see any box, the hook could close it
as soon as it fetched the button texts. Anyway, that was merely
a suggestion of how to get those yes/no strings without relying on
hardcoded resource IDs. Since the button IDs themselves IDYES/IDNO
are publicly documented, as are the hook procedures, this would qualify
as an almost "official" way to do it. But I never said it was pretty ;-)

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

If you have access to the subscriber downloads on msdn (or technet)
maybe the following could help, too - Microsoft Terminology Translations
http://msdn.microsoft.com/en-us/goglobal/bb688105.aspx.

Liviu


From: Mihai N. on

> Nice idea. I tend to fetch the locale data from GLibc and create a file
> from that using some shell or perl script.


glibc is not MS, I thought you wanted the runtime MS localization.

But if all you want is the localization for Yes/No, then you can do
several things:

1. If you need the localization for Yes/No, you probably need it for
your localized product.
If that is the case, all the other strings for the product must
be localized, so you can just include the Yes/No in the strings
to localized.

2. If you want the MS localization, you can get it from the DLLs
indicated. As long as you copy that translation in your own
sources, it's safe. That will never change from under you :-)

3. You can use the MS glossaries, as Liviu sugested

4. You can dig in glibc

5. You can use CLDR (Common Locale Data Repository)
http://cldr.unicode.org/
Or access the data directly from ftp://ftp.unicode.org/Public/cldr/1.7.2
the posix.zip file
The string IDs are in the LC_MESSAGES section


But note that none of these is what you initialy asked for: a runtime
way to retrieve the strings that Windows uses.


--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

From: Corinna Vinschen on
Mihai N. wrote:
> glibc is not MS, I thought you wanted the runtime MS localization.

Yes. As I wrote, I'm using it to implement every other POSIX locale
category. Just the content for the LC_MESSAGES information is missing.

> 1. If you need the localization for Yes/No, you probably need it for
> your localized product.

No. I'm just looking for the POSIX LC_MESSAGES information to provide
the LC_MESSAGES category data to other packages, depending on the
setting of the POSIX locale environment variables.

> 5. You can use CLDR (Common Locale Data Repository)
> http://cldr.unicode.org/
> Or access the data directly from ftp://ftp.unicode.org/Public/cldr/1.7.2
> the posix.zip file
> The string IDs are in the LC_MESSAGES section

Thanks for the pointer!

> But note that none of these is what you initialy asked for: a runtime
> way to retrieve the strings that Windows uses.

Right, but since the information isn't available, apparently, I have to
implement providing the LC_MESSAGES category data using another method.
That's what has been discussed in this thread. Thanks again for the
above pointer. I'll use that as input.


Corinna

--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
From: PJ on Development on
The USER32.dll is indeed the repository for localized string in Windows.

However, it does not not contains multiple string tables, only one.

I've access to some other localized Windows versions (pt-BR, es-ES, among
others) and in every one of them the following positions are fixed from
Window XP through Windows 7:

800 - OK
801 - Cancel
802 - &Abort
803 - &Retry
804 - &Ignore
805 - &Yes
806 - &No
807 - &Close
808 - Help
809 - &Try Again
810 - &Continue
900 - Minimize
901 - Maximize
902 - Restore Up
903 - Restore Down
904 - Help
905 - Close

The above list in en-US, obviously, but in, say, pt-BR it says:

800 - OK
801 - Cancelar
802 - &Anular
803 - &Repetir
804 - &Ignorar
805 - &Sim
806 - &Não
807 - &Fechar
808 - Ajuda
809 - Te&ntar novamente
810 - &Continuar
900 - Minimizar
901 - Maximizar
902 - Restaurar acima
903 - Restaurar abaixo
904 - Ajuda
905 - Fechar

So, it's fairly certain that these strings will not change in any
foreseeable future, and the IDs are consistent among the localized Windows
out there.

"Pavel A." wrote:

> Look in string table resources of user32.dll.
> "&Yes" is id=805, "&No" is id=806 (on XP SP3, x86)
>
> --pa
>
>
> "Corinna Vinschen" <corinna(a)community.nospam> wrote in message
> news:hja7rp$1h8$1(a)perth.hirmke.de...
> > Hi,
> >
> > I've searched MSDN and the Win32 API a lot, but I can't figure out
> > if this information is available somewhere. What I'm searching are
> > locale-specific strings with the meaning "Yes" or "No". There's a
> > lot of locale-specific information available via GetLocelInfo(Ex),
> > but apparently not this.
> >
> > Is there an API which returns this sort of localized strings?
> >
> >
> > Thanks in advance,
> > Corinna
> >
> > --
> > Corinna Vinschen
> > Cygwin Project Co-Leader
> > Red Hat
>
> .
>
From: Mihai N. on

> So, it's fairly certain that these strings will not change in any
> foreseeable future

There is no such certainty.



--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email