Re: Substituting the main menu bar(s)
- From: David Wilkinson <no-reply@xxxxxxxxxxxx>
- Date: Sun, 04 Jun 2006 16:35:53 -0400
David Webber wrote:
"KMA" <kma@xxxxxxxxxxxxxxx> wrote in message news:e5mvgi$k2u$1@xxxxxxxxxxxxxxxxxxxx
Alternatively, you could leave your English(?) menu where it is but just change the strings for each item at runtime based upon the current language regime. Not as tricky as you might think, and has the advantage that you don't have to edit n menus each time you add a feature. Then take the feature out. Then decide to add it again. Then move it to a different place in the order.
Glad to see you're sticking with the localisation. Be interesting to hear if you found and good tips or pitfalls.
After our discussion a while back (which I found enormously helpful - thanks) I proceeded in a slightly different way from your method (but nevertheless inspired by it).
1. I have tab-separated-value table of strings maintained with Excel, with a column for each language. These include string-table items, strings from dialogue templates, strings from menus,...
2. I wrote a translation application* which takes as input:
the table of translations
the english rc file
and outputs
an rc file in each language.
All it does is replace the strings according to the translation table.
3. I have a resource-only DLL project for each foreign language, which uses the generated rc files.
4. I also have a batch file which calls the translation app, and then invokes the compiler on each resource-only DLL project. I can thus add a new translated string and run the batch file very quickly.
There are two disadvantages to this:
a) My application knows to look in the selected language DLL for the resources. Selecting a new language works immediately for everything except the menus as these are loaded at the start and remembered by the application framework. To get the new language on the menu, I currently have to exit the app, and go in again, so that the new language menus are picked up by th InitInstance stuff. That's why I wanted to replace the menus which the AFX stuff knows about.
I want to click on the "present program in French" button, and tell the AFX to replace the two menus it knows about with two from the French language resource-only DLL. This seems to involve puting ones hands deep into the engine of MFC :-(
b) Dialogue strings can easily get too big for the available space. This just requires care. One thing I am moving towards is purely iconic dialogue buttons with tool tips explaining what they do this gets round the space problems very elegantly, but isn't possible everywhere.
But the advantage over your method is that I don't have to program every menu and dialogue class to load strings for all its controls. (I have nothing against that in principle but the program was first released in 1994 and by now there are a LOT of them!)
Dave
Hi Dave:
Like you, I was greatly inspired by the previous "KMA thread", though unlike you I have not actually done anything about it! Most of my thoughts have been along the "single set of resources with on-the-fly substitution" rather than multiple resources as you have moved toward. But I agree that having everything in one place is a key feature.
A couple of thoughts about your method:
1. I like your idea of translated tooltips rather than translated buttons/controls. I personally am graphically impaired, so I might leave the control text in English.
2. How do you add tooltips to dialog controls? The way I know how to do it is a task of similar program modification to writing code to replace all the control text.
3. I am very doubtful if in my case spending a lot of effort on translation will be worth while. But it occurs to me that a totally minimal effort would be to translate only tooltips, status bar tips, and message boxes. Desirable features:
1. Involves only the string table, not the whole .rc file.
2. No resizing problems.
3. We agreed last time that translating the help system is a huge task. In my case, I just don't think it will happen. But if you translate all the control and menu item text, then the help system will no longer match the application as seen by the user (so, in a sense, the translation has made things worse). Translating only tooltips and message boxes seems to mesh well with an English-only help system. Maybe a simple dictionary of technical terms (for each language) would be a minimal improvement here.
Just one ex-physicist, ex-FORTRAN, self-taught, self employed MFC programmer rambling to another ...
David Wilkinson
.
- Follow-Ups:
- Re: Substituting the main menu bar(s)
- From: KMA
- Re: Substituting the main menu bar(s)
- From: David Webber
- Re: Substituting the main menu bar(s)
- References:
- Substituting the main menu bar(s)
- From: David Webber
- Re: Substituting the main menu bar(s)
- From: David Wilkinson
- Re: Substituting the main menu bar(s)
- From: KMA
- Re: Substituting the main menu bar(s)
- From: David Webber
- Substituting the main menu bar(s)
- Prev by Date: Re: Substituting the main menu bar(s)
- Next by Date: Re: Substituting the main menu bar(s)
- Previous by thread: Re: Substituting the main menu bar(s)
- Next by thread: Re: Substituting the main menu bar(s)
- Index(es):