Discussion:
Use defined locale if it is possible
(too old to reply)
Renat Letfullin
2010-02-01 12:29:55 UTC
Permalink
Dear all,

have a problem with UI language.
In our application (Visual C++, MFC) we have two resources: English
and Russian.

We want to display Russian if it is possible for target system or
English otherwise.
What LANGUAGE definitions in resource script should we use in this
case?
Is it possible to solve this problem by LANGUAGE definitions in
resource script or we should determine target system default, system
and UI languages in application?

Possible target systems: Windows 2000, Windows XP, Windows Server
2003, Windows Vista, Windows Server 2008, Windows 7, Windows Server
2008 R2

PS: It is possible to find combinations of LANGUAGE definitions to
display languages correctly, but only if there's no Language Packs on
system. For example, if target system is Windows 7 with Russian
Language Pack and display language is set to English, "??????" instead
of Russian or English languages displayed.
Mihai N.
2010-02-02 07:26:08 UTC
Permalink
Post by Renat Letfullin
We want to display Russian if it is possible for target system or
English otherwise.
It is always possible to display Russian, if the application is Unicode.

It is not Unicode, and too big to change it, then you should look at the
system code page (or "ANSI" code page), using GetACP().
If the value is 1251, then you can display Russian even with a non-Unicode
application.

Nothing to do with LANGUAGE.
That does not come into play, unless you are trying to store both Russian and
English in the same executable/dll.
That is not recomended, the "best current practice" is to have separate
resource only dll for each langage (so a Russian dll, and an English dll).
You determine language what you, load the proper dll, and load resources
from there.
If you do that, LANGUAGE does not matter.
--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Renat Letfullin
2010-02-02 14:08:52 UTC
Permalink
Post by Mihai N.
Post by Renat Letfullin
We want to display Russian if it is possible for target system or
English otherwise.
It is always possible to display Russian, if the application is Unicode.
It is not Unicode, and too big to change it, then you should look at the
system code page (or "ANSI" code page), using GetACP().
If the value is 1251, then you can display Russian even with a non-Unicode
application.
Nothing to do with LANGUAGE.
That does not come into play, unless you are trying to store both Russian and
English in the same executable/dll.
That is not recomended, the "best current practice" is to have separate
resource only dll for each langage (so a Russian dll, and an English dll).
You determine language what you, load the proper dll, and load resources
from there.
If you do that, LANGUAGE does not matter.
--
Mihai Nita [Microsoft MVP, Visual C++]http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Thank you!

Loading...