Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Navigation Bar string definitions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AdrianS
Senior Member

Canada
30 Posts

Posted - Oct 19 2011 :  4:30:14 PM  Show Profile  Reply with Quote
One of VAX's handy features for C++ is the display of string definitions from the RC string table. We have stated adding internationalized RCs to our solution and now the foreign languages are being used for the string definitions, instead of English.

Is there a way that I can control which RC's string table defintions are used in the Navigation Bar?

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Oct 20 2011 :  12:43:20 PM  Show Profile  Reply with Quote
How have you set up the multiple languages in the string table? After a bit of searching I found a sample project that shows one method of doing this here:

http://www.codeproject.com/KB/locale/LanguageMenu.aspx

There are 3 projects in the one solution, each project has its own string table, and each string table contains only a single language, but they have the same ID's. Is this the method you are using? Or are you doing something else?

VA would need some method of knowing which strings you want to see in the navigation bar, so I am wondering how this could be defined / specified.

zen is the art of being at one with the two'ness
Go to Top of Page

AdrianS
Senior Member

Canada
30 Posts

Posted - Oct 20 2011 :  1:36:01 PM  Show Profile  Reply with Quote
Yes, we're using the resource DLL (AKA satellite DLL) approach. Each language in our solution has a project associated with it that produces a resource-only DLL.

I didn't read the full CodeProject article, but it does appear to describe the technigue that we're using.
quote:
each project has its own string table, and each string table contains only a single language, but they have the same ID's. Is this the method you are using?

Yes, that's what we're doing.
quote:
VA would need some method of knowing which strings you want to see in the navigation bar, so I am wondering how this could be defined / specified.

Without knowing too much about how VAX parses the string table, I can't make any really good suggestions. One possibility might be to specify which resource project should be used. Another alternative would be a user setting for "preferred resource language". VAX could then use the LANGUAGE declaration(s) in the RC file to decide which string table to use. An advantage to this approach is that it would also work where multiple languages are specified in one RC.

A different approach would be a more general "exclude project" setting that prevents VAX from parsing the project at all.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Oct 20 2011 :  4:31:09 PM  Show Profile  Reply with Quote
This helps, it means the testing I am doing in the sample project from codeproject should be representative of what you are seeing.

If you use the pull down arrow at the right hand end of the VA definition field are you seeing all languages? All known definitions should be shown in this list, assuming there is more than one.

If you hover the mouse over the string table ID what do you see in the tooltip? For me I am seeing two different languages, two different string values.

Also if I press Alt-g the string values are being given in the Alt-g menu, along with the rc file names and line numbers.

Are you seeing the English strings, along with the localised strings, when you do this?

Excluding the other .rc files from VA might very well work, I like this idea, and it is simpler than adding some method to tell VA which language to use first, since we cannot assume English should come first. Not everyone has English as their first language, after all.

We are looking to add a feature to VA where you can specify certain directories to ignore:

case=8814

Alternatively, you could try adding #define statements for your string ID's to VA's StdAfx.h file, as described here:

http://docs.wholetomato.com?W302

Perhaps something like:

#define ID_FILE_OPEN "file open"

I have not tested this here, but in theory, since these would be in VA's StdAfx.h file, they should take precedence and be displayed in the VA navigation bar. Obviously this will only work if you have a reasonably small and stable list of strings.

zen is the art of being at one with the two'ness
Go to Top of Page

AdrianS
Senior Member

Canada
30 Posts

Posted - Oct 21 2011 :  10:50:03 AM  Show Profile  Reply with Quote
Yes, I'm seeing the defintions in all three places that you've suggested.

Because of some issue that I don't recall, I had turned the tooltips off in VS2005 and forgatten to turn them back on in VS2010. For most of my purposes, the tooltips will suffice, but they do require mouse navigation. Also a small advantage of the Navigation Bar is that the string text can be copied to the clipboard.

Ealier incarnations of our solution used realitive values for the string IDs, e.g. #define STRING_ID (Base+123). The Navigation Bar can resolve that to the string, but the tooltip doesn't. Our newer solution uses absolute values for the IDs, so that problem doesn't occur.

Our string table has a couple of thousand strings, so the stdafx.h approach is not really workable.

Oddly enough, the English strings are now showing up in the Navigation Bar as the default. If the foreign strings become the deafault again, I'll try to see what it takes to switch them back.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Oct 21 2011 :  12:19:04 PM  Show Profile  Reply with Quote
To trigger the tooltip with the keyboard, try CTRL-K, CTRL-I, which is bound to Edit.QuickInfo for me.

To copy the string, you can simply move focus into the VA definition field, select the definition you want, and copy the text from there.

Strange, I am not sure why the language you are seeing is changing, but I am glad you are back to seeing English first, since this is clearly helpful.

zen is the art of being at one with the two'ness
Go to Top of Page

AdrianS
Senior Member

Canada
30 Posts

Posted - Oct 24 2011 :  08:04:25 AM  Show Profile  Reply with Quote
quote:
I'll try to see what it takes to switch them back

I found a way to get the desired language strings to the top of the string choices for the Navigation Bar, tooltips, etc.. It turns out to be pretty obvious:
  • Open the desired language's RC file in the text editor
  • Use the VAX "Reparse Current File" command

That gets the RC's strings back to the top of the list.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Oct 24 2011 :  11:34:45 AM  Show Profile  Reply with Quote
As you say, this is simple and obvious solution, thank you for posting this

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000