15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Language depended resources

Steen Rabol -- srabol@vip.cybercity.dk
Friday, May 10, 1996

Hello

[ Enviroment Win95 (Danish) VC++ 4.1 ]

I have a application which I would like to support different 
languages, according to the documentation and Technote 57 the 
resource editor can create language depended resources, but nomatter 
how I try to compile the project I end up with the same recources.

Anyone have a hint ??

Thanks in advance.
Best
Steen

--------------------------------------------------------
 Email   : srabol@vip.cybercity.dk
         : scsr@pip.dknet.dk
 WWW     : http://www.cybercity.dk/users/ccc2277/home.html

           The home of WebDesigner - a HTML text editor



Lin Sebastian Kayser -- 100532.2621@compuserve.com
Sunday, May 12, 1996

Your program always uses the locale information of your operating
system. That means that if you have a US Windows 95 you will always get
the US resources. If you have a Danish Windows 95 you will get the
Danish resources and so on. As far as I know there is no way in Windows
95 to change the locale of your main thread from inside your
application. Under Windows NT there is the SetThreadLocale() function
declared in winnls.h.

Regards,

Lin

+--------------------------------------------------------+
|     Lin Sebastian Kayser @ Lizard Software, Germany    |
|  High Speed CNC System Software for ARADEX Automation  |
|   http://ourworld.compuserve.com/homepages/Lin_Kayser  |
+--------------------------------------------------------+

...writing at 14:24:50 12-May-1996 (GMT +1:00)




Luca Orlandi -- Luca.Orlandi@inferentia.it
Monday, May 13, 1996

>Hello
>
>[ Enviroment Win95 (Danish) VC++ 4.1 ]
>
>I have a application which I would like to support different=20

>languages, according to the documentation and Technote 57 the=20
>resource editor can create language depended resources, but nomatter=20
>how I try to compile the project I end up with the same recources.

Win32 let's you describe multiple resources with the same identifier =
into the same resource script; the function FindResource() identifies =
the correct resource depending on the language currently selected =
(language neutral if no language is appropriate) ,,, but ... "In Windows =
95, multiple copies of a resource with exactly the same ID and resource =
type cannot be loaded at the same time. Thus, the only value of LANGUAGE =
that works is the one that matches the current locale. ..."

Following TN035 I've configurade my makefile to build different language =
applications reading most resources (all except STRINGTABLE) from a =
single RC file. If you need an example dont's esitate to mail me.

Fonts & reference:

MFC Technical notes: "TN035: Using Multiple Resource Files and Header =
Files with Visual C++"
Technet:Q140763 "LANGUAGE Statement in RC Differs in Windows NT from =
Windows 95"


------------------------
http://www.inferentia.it/net.drive
http://www.inferentia.it/users/lrkwz



PHILLIP FORD -- PHILLIP.FORD@spcorp.com
Tuesday, May 14, 1996

[Mini-digest: 3 responses]

     The way I have seen it done is with resource strings and an 
     offset value for the current language.  If the string resource 
     area is as follows:
     
     10,"string 0 in English"
     11,"string 1 in English"
            .
            .
            .
     
     20,"string 0 in Greek"
     21,"string 1 in Greek"
            .
            .
            .
     
     30,"string 0 in xyz"
     31,"string 1 in xyz"
     
     Now in the program set a variable that denotes the language:
     lang=10;  //for English
     lang=20;  //for Greek
     lang=30;  //for xyz
     
     Then in dialogs and screens use string_id + lang to refer to the 
     proper string in the proper language.
     
     Phillip  8-)  (first time response - hope it helps - had to get   
                       my feet wet sometime)
     

-----From: marksi@eskimo.com (Mark Simonton)

I'm sure someone else has mentioned this (but I don't see a response
yet).  

You need to install the codepages you are targeting to be able to access
the information for other languages (character sets, sort order); and
for far east projects you need to install the targeted language OS to
get the character sets.  Unicode supports quite a few, but of course
popular OS's like Win95 don't use Unicode yet, since it is too big and
doesn't provide enough benifit, yet.

-----From: Ji Song <101762.3041@compuserve.com>

It has been described in the book Developing International Software and a
series of
article in MSJ.  Bascially, you have to construct a language ID and pass to

FindResourceEx.  FindResourceEx takes a language ID.

Ji.




| Вернуться в корень Архива |