Problem in Resource Language 
Author Message
 Problem in Resource Language

Hi Thomas,

When you insert the resource, right-click on it in the resource view, and select
properties. You'll notice that the dialog that pops-up is somewhat different
that you'd get with the resource open in the editor, and that it will allow you
to select the resource language from a drop down lit. Simply select the one you
want.
--
Tomas Restrepo

http://www.*-*-*.com/


Quote:
> Hi everyone! I'm quite new to Visual C++. I need some help here. I am using
> Visual C++ 6.0.

> My Windows regional settings is set as English (Britain). I select English
> (U.S.) when I generate a AppWizard code, I notice that everytime when I
> insert a new resource, it will be insert under the English (U.K.) Resource
> sections. But I notice those resources won't get compiled unless I comment
> out the LANGUAGE statments in the RC file.

> How to "force" the resource editor so that it will create resources under
> the English (U.S.) Resource sections without altering my Windows regional
> settings.

> I had tried selecting English (U.S) in the Project | Settings | Resource,
> but it seems doesn't work - the problem persist.

> Can anyone help??
> Thanks in advance!

> Regards,
> Thomas.



Tue, 25 Sep 2001 03:00:00 GMT  
 Problem in Resource Language
Hi everyone! I'm quite new to Visual C++. I need some help here. I am using
Visual C++ 6.0.

My Windows regional settings is set as English (Britain). I select English
(U.S.) when I generate a AppWizard code, I notice that everytime when I
insert a new resource, it will be insert under the English (U.K.) Resource
sections. But I notice those resources won't get compiled unless I comment
out the LANGUAGE statments in the RC file.

How to "force" the resource editor so that it will create resources under
the English (U.S.) Resource sections without altering my Windows regional
settings.

I had tried selecting English (U.S) in the Project | Settings | Resource,
but it seems doesn't work - the problem persist.

Can anyone help??
Thanks in advance!

Regards,
Thomas.



Wed, 26 Sep 2001 03:00:00 GMT  
 Problem in Resource Language
Hi everyone! I'm quite new to Visual C++. I need some help here. I am using
Visual C++ 6.0.

My Windows regional settings is set as English (Britain). I select English
(U.S.) when I generate a AppWizard code, I notice that everytime when I
insert a new resource, it will be insert under the English (U.K.) Resource
sections. But I notice those resources won't get compiled unless I comment
out the LANGUAGE statments in the RC file.

How to "force" the resource editor so that it will create resources under
the English (U.S.) Resource sections without altering my Windows regional
settings.

I had tried selecting English (U.S) in the Project | Settings | Resource,
but it seems doesn't work - the problem persist.

Can anyone help??
Thanks in advance!

Regards,
Thomas.



Wed, 26 Sep 2001 03:00:00 GMT  
 Problem in Resource Language
Hi Tomas,

Thanks for your help! But I still have some questions to ask you. Sorry for
bothering you again.

By using your method, i.e. select the resource language from Properties
dialog when right-clicking on resource view, I manage to create a same
resource of different language.

But then, how do I tell the compiler to compile only the resource with the
language I specified. For example, let said I have two menus which is
physically the same, but differs in their language, let said they are in
English and German respectively. How do I tell the resource compiler to
compile only the English resource or only the German resource.

Better still, can I compile both of them and let the OS decide the correct
resource at run-time?

I had tried choosing different language from the Project | Settings |
Resource, but it seems doesn't make any changes.
What are those for anyway?

If you don't mind and have time, I would really appreciate if you could give
me a brief tutor text on managing different languages of resources in Visual
C++. I am quite new to Visual C++ and I don't have any past experience on
creating multilingual application. This is the first time.

Thanks a lot!
You are really an honorable man, Tomas.

Sincerely,
Thomas.

Quote:

>Hi Thomas,

>When you insert the resource, right-click on it in the resource view, and
select
>properties. You'll notice that the dialog that pops-up is somewhat
different
>that you'd get with the resource open in the editor, and that it will allow
you
>to select the resource language from a drop down lit. Simply select the one
you
>want.
>> Hi everyone! I'm quite new to Visual C++. I need some help here. I am
using
>> Visual C++ 6.0.

>> My Windows regional settings is set as English (Britain). I select
English
>> (U.S.) when I generate a AppWizard code, I notice that everytime when I
>> insert a new resource, it will be insert under the English (U.K.)
Resource
>> sections. But I notice those resources won't get compiled unless I
comment
>> out the LANGUAGE statments in the RC file.

>> How to "force" the resource editor so that it will create resources under
>> the English (U.S.) Resource sections without altering my Windows regional
>> settings.

>> I had tried selecting English (U.S) in the Project | Settings | Resource,
>> but it seems doesn't work - the problem persist.

>> Can anyone help??
>> Thanks in advance!



Wed, 26 Sep 2001 03:00:00 GMT  
 Problem in Resource Language
Hi Thomas,

Quote:
> Thanks for your help! But I still have some questions to ask you. Sorry for
> bothering you again.

> By using your method, i.e. select the resource language from Properties
> dialog when right-clicking on resource view, I manage to create a same
> resource of different language.

> But then, how do I tell the compiler to compile only the resource with the
> language I specified. For example, let said I have two menus which is
> physically the same, but differs in their language, let said they are in
> English and German respectively. How do I tell the resource compiler to
> compile only the English resource or only the German resource.

Good question, and the answer depends on your preference. However, it relies on
conditional compilation. The trick is to modify the .rc file to ignore one or
other language when compiling, by defining a symbol. Unfortunately, this makes
it harder to maintain the resource file. I myself prefer to do this:
1- First, I create all resource, in all languages in the same .rc file created
by VC++ in the reosurce editor.
2- Then, I manually create a .rc file for each language I have. Usually I don't
use more than 2, so that's no problem. Then I open the resource file in notepad,
and copy the language specific resources to the respective file. For example,
spanish resources might go into spa.rc, while english resources might go into
eng.rc. Of course, once that's removed from the original .rc file, I'm left with
only language neutral resources in it, which is good.
3- Now, I used preprocessor directives to #include one of the localized .rc
files in the main .rc file, like this:
#ifdef TARGET_SPA
#include "spa.rc"
#endif
#ifdef TARGET_ENG
#include "eng.spa"
#endif
fter that, it's a simple matter of modifying the project settings to define
either symbol when compiling the resources to get either language. I know it's
not a perfect solution, and it requires too much manual tweaking, but it works
for me.

Quote:

> Better still, can I compile both of them and let the OS decide the correct
> resource at run-time?

Well, yes you can. Actually, if you don't touch the.rc file produced by VC, all
resources will be compiled into the .exe, regardless of their language. The
language setting in the reource tab in project -> settings only specifies which
codepage the resource file should be compiled in. The codepage doesn't specify
the language itself, it merely specifies which character set to use.

Now, when the app tries to load a resource, different windows versions behave
differently. For Example WinNT will try to load first the resource whose
language id matches that of the calling thread. Win9x, will load first the one
whose language id matches the default system language ID. If either fails, it
will try to load a resource whose primary language matches the one specified (by
the rules above). If several resource have the same primarey langid, but
different sublanguage, the first encountered will be loaded. Finally, failing
this, windows will try to find a language neutral resource.
So technically, what you want is perfectly possible.

However, there's a caveat. Things are not quite so easy. the problem is that you
might get unexpected behavior if you don't plan things very well. To illustrate
this, let me use an example:
My computer settings specify as language: Spanish (Colombia), which correspond
to : Spanish - International language and sublanguage id. (That's LANG_SPANISH,
SUBLANG_SPANISH_COLOMBIA). But as you can guess by now, this is not one of the
languages directly supported by VC. Instead, we have three sorts: Spanish -
Modern, Spanish - Castillian, Spanish - Mexican. Which one matches? Good
question. If I was asked, I'd say Spanish - Modern, but as it turns out, that
won't work. Spanishj - Castillian, however, will even though that's not
completely correct.

So the lesson here is that be very carefull when selecting the language id, and
matching them to the target locale. Otherwise, you might end up with the wrong
resource loaded. Finally, let me say, that while this feature is very powerful,
there's another reason I avoid it: With many resources in a file, having all
languages in can really bloat the resulting file. This is one of those times,
when localized resource-only dlls suddently become very attractive alternatives.

Quote:

> I had tried choosing different language from the Project | Settings |
> Resource, but it seems doesn't make any changes.
> What are those for anyway?

As I said above, it merely specifies the character set used to compile the .rc
file

Quote:

> If you don't mind and have time, I would really appreciate if you could give
> me a brief tutor text on managing different languages of resources in Visual
> C++. I am quite new to Visual C++ and I don't have any past experience on
> creating multilingual application. This is the first time.

Well, I guess I just have. Now, I'm not an expert in this field. I'm merely
talking form expirence, and it's not much :) But I can recommend some reading.
on the MSDN CD that comes with VC, is the complete text from an old book called
"Developing International Software For Windows 95 and Windows NT". Most of
what's said in there still applies, and it will give you some good pointers to
start with.

Hope any of this helps!

--
Tomas Restrepo

http://members.xoom.com/trestrep/



Wed, 26 Sep 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Problem in Resource Language

2. Problem inlcuding a multi language resource in another resource

3. Mutiple Language Resource problem!!!

4. VC4 LANGUAGE resource problem.

5. Problems with Multi-language resource-dll

6. multi-language support resource problem.

7. Linking...CVTRES : fatal error CVT1100: duplicate resource resource -- type:VERSION, name:1, language:0x0409

8. Default resource language in wizard - how to change?

9. Insert Resource Copy: Language?

10. Use of "Insert Resource Copy: Language"?

11. Managing multi-language resource

12. Resource file language translation

 

 
Powered by phpBB® Forum Software