Translating Dialog text - do I need multiple dialogs?

Hello,

Firstly I am new to MFC so apologies for what is I am assuming a very
basic question!
Summary: I am writing an MFC application which contains one simple
dialog and up to 6 message boxes. I need to provide the application in
both English and German. The dialog contains a title and static text,
both of which will need to be translated. The buttons on the dialog
will also need to be translated. The 6 message boxes contain text to
be translated, titles to be translated and the button names must also
be transated. In total there will only be about 10 strings to be
translated.

My questions are:
1) Is there anyway to set the Caption of the static text on the Dialog
to be one of the IDs in the String table? Ie Setting caption to be
IDS_WELCOME rather than having to put in the actual welcome text
itself? I tried just putting in IDS_WELCOME in the caption but it just
printed out this exact text!! If this is not possible, does this mean
a different dialog would be needed for each language, ie
IDD_DIALOG_GERMAN and IDD_DIALOG_ENGLISH and the buttons and titles
would be translated for each specific dialog? If the latter is the
case, I assume I would then write code to determine which language
should be used and depending on this, display the appropriate
IDD_DIALOG_XXX? Would the second dialog be added to the enumeration in
the Dialog header file, currently there is just one: enum { IDD =
IDD_EXTRACTOR_DIALOG };

2) How are the String tables chosen by MFC? Would I have a different
String table for German and a different String table for English and
have the same IDs in each table with different translations? If this
is the case how do I load the appropriate String table? I know there
is function LoadString but this is just loading one String, as opposed
to a String table isn't it? Or the AfxSetResourceHandle function but
from my understanding this is for loading a DLL as opposed to a String
table. Or would I just have one String table and have different IDS
for different languages ie IDS_WELCOME_GERMAN or IDS_WELCOME_ENGLISH
and then when I am displaying a message box do a code check to decide
which message to display? This doesn't seem like the most efficient
way??!!

3) The message boxes either have OK, CANCEL or RETRY buttons so I am
using MB_OK, MB_OKCANCEL etc in my code. But, when the application is
displayed in German, I will need to translate the button text too -
how do I go about doing this as I don't see any option in the
MessageBox function for customizing the text on these buttons?

4) I would prefer not to have to create an extra Resource DLL for each
language as a) my application is a self extracting executable so I
assume I would need to add this dll to the archive if I was using it
and my aim is to keep this executable as small as possible and b)
seeing as there are only about 10 strings to be translated, I am not
sure it would be necessary??? Or maybe there is no other way around it
I don't know?!!

5) In the Project Settings where a language can be selected, if you
select German here does that mean the German String table is used or
how does this work? This would not suit my requirements I assume as I
won't know until run time which language I need to use (basically I do
a check on the users OS, if its German I display the application in
German, if its anything other than German, I want to display the
application in English).

Thanks a million in advance for your help as I know this is probably
very straightforward but at the moment I am just going around in
circles!!

Cheers!
Mary
0
1/12/2005 4:49:10 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
348 Views

Similar Articles

[PageSpeed] 39

1) Is there anyway to set the Caption of the static text on the Dialog
> to be one of the IDs in the String table? Ie Setting caption to be
> IDS_WELCOME rather than having to put in the actual welcome text
> itself? I tried just putting in IDS_WELCOME in the caption but it
just
> printed out this exact text!! If this is not possible, does this mean
> a different dialog would be needed for each language, ie
> IDD_DIALOG_GERMAN and IDD_DIALOG_ENGLISH and the buttons and titles
> would be translated for each specific dialog? If the latter is the
> case, I assume I would then write code to determine which language
> should be used and depending on this, display the appropriate
> IDD_DIALOG_XXX? Would the second dialog be added to the enumeration
in
> the Dialog header file, currently there is just one: enum { IDD =
> IDD_EXTRACTOR_DIALOG };


The way I would approach this is to have two separate resource files;
one in English and other in German. In addition, you can put all your
strings in separte resource files as well. You can then load the
strings dynamically and display the controls with these strings.

The reason for having two separte resouce files for dialogs etc is
because string lengths may differ between English/German. This gives
the flexibility to take care of any issues.


> How are the String tables chosen by MFC? Would I have a different
> String table for German and a different String table for English and
> have the same IDs in each table with different translations? If this
> is the case how do I load the appropriate String table? I know there
> is function LoadString but this is just loading one String, as
opposed
> to a String table isn't it? Or the AfxSetResourceHandle function but
> from my understanding this is for loading a DLL as opposed to a
String
> table. Or would I just have one String table and have different IDS
> for different languages ie IDS_WELCOME_GERMAN or IDS_WELCOME_ENGLISH
> and then when I am displaying a message box do a code check to decide
> which message to display? This doesn't seem like the most efficient
> way??!!

MFC does not really chose the string table. You supply your resouce dll
which has the string table etc. Now you could supply a different dll
based on the context. For example for German, you could supply the
resource dll which has all strings in German.

4) I would prefer not to have to create an extra Resource DLL for each
> language as a) my application is a self extracting executable so I
> assume I would need to add this dll to the archive if I was using it
> and my aim is to keep this executable as small as possible and b)
> seeing as there are only about 10 strings to be translated, I am not
> sure it would be necessary??? Or maybe there is no other way around
it
> I don't know?!!

If your project is small and you dont expect the resources that need
translation to grow, you can put all this in one dll but then you will
need to switch the strings yourself according to what version you are
running.


------------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6842)
1/12/2005 5:38:13 PM
>1) Is there anyway to set the Caption of the static text on the Dialog
>to be one of the IDs in the String table?

Only if you add code to load the resource string and set the dialog's
caption with it.

>2) How are the String tables chosen by MFC? Would I have a different
>String table for German and a different String table for English and
>have the same IDs in each table with different translations?

I believe that's the way it's supposed to work, but I think it behaves
differently in different OS's. I think the MS recommended method of
translation is to do what you don't want to do - and use a separate
resource DLL.

Dave
0
davidl7375 (2060)
1/12/2005 5:48:28 PM
Reply:

Similar Artilces:

Stagger X-axis text
In 1-2-3 I could stagger the text in the X-axis. In Excel it seems that I can only rotate the text to 90 degrees. Is there a way to stagger and leave horizontal? Specifically, I have all the provinces (or 10 of them) across the axis and they take up room when spelt out (no abbreviations allowed). I would rather the first, third, fifth ... etc. be higher and the second, fourth etc. be lower to allow the chart to be narrower and still read the text clearly. Cheers, Deborah >-----Original Message----- >In 1-2-3 I could stagger the text in the X-axis. In Excel it seems Deborah I would...

Outlook 2003
Is there a way to force all incoming email to be received as plain text in OL-2003? TIA -- howard How about: "Tools | Options | E-Mail Options | Read all standard mail in plain text"? -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP Stockholm Consulting Group/KSG http://www.scgab.com Microsoft OneNote FAQ: http://home.hawaii.rr.com/schorr/computers/onenotefaq.htm **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! "Howard Cross" <no-spam@No-Spam.com> wrote in message ...

How do I get excel to accept (c) as text and not change to copyri.
How do I enter the text (c) in Excel without having it changed into the copyright symbol? Hi Daffyd, Try: Tools | Autocorrect | Select (c) | Delete | OK --- Regards, Norman "daffyd" <daffyd@discussions.microsoft.com> wrote in message news:8CCC3C1A-6F19-4F62-B934-8A71F236A4FD@microsoft.com... > How do I enter the text (c) in Excel without having it changed into the > copyright symbol? Go into the Tools Menu. Look for AutoCorrect. In the bottom half of the AutoCorrect Tab, look at the list for Replace text as you type. Delete the entry for (c). tj "da...

Printing Multiple Receipts at a Time From Journal
Hey guys, Is there a way to print multiple journaled receipts at a time? Say all receipts for a batch or by date or other criteria? Thanks Tom, Not that I've seen. -- = Get Secure! - www.microsoft.com/security You must be using Outlook Express or some other type of newsgroup reader to see and download the file attachment. If you are not using a reader, follow the link below to setup Outlook Express. Click on "Open with newsreader" under the MS Retail Management System on the right. http://tinyurl.com/75bgz ========== "Tom Bombadill" <Genius_pos...

Convert single colum/multiple rows to multiple colums.
Hi, I have a .dat file when opened with Excel it has 1 column and 7 rows per entry. I would like to delete some rows and convert the rest to something like. Any chance this can be done. It's quite large. 51,793 rows. TIA Jeff Col 1 Col 2 Col 3 Name Date Lenny Kravitz - 2000 - Greatest Hits -- Table: {2} { "music" "Name", "06/04/2008", "Lenny Kravitz - 2000 - Greatest Hits", }, --Table: {3} etc. etc. ...

To write living will do I need special format
I just need to change and update a living trust You should consult someone with the appropriate legal knowledge in the jurisdiction in which you are domiciled. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "belladonna" <belladonna@discussions.microsoft.com> wrote in message news:F25A64CB-355F-44E9-A005-16AA61DA15A7@microsoft.com... > I just need to change and update a living trust ...

Multiple Outlook #2
I imported an Outlook 2000 pst file into Outlook 2003. Now when I open Outlook my Personal Folders appears 4 times in the left hand "All Mail Folders" When I close Outlook it gives me an error and msvbvm60.dll is mentioned. Any help on how to correct this issue would be greatly appreciated. Mick ...

Need help getting this code to compile under VS.NET 2003 (compiles under VS6.0).
I'm tasked with converting a LARGE project from VS6.0 to VS.NET 2003. Here is a VERY scaled down version of an error I'm getting. I must be getting rusty, but the way to get around this compiler error is just not coming to me. If you need to compile this, just create a Win32 console app and specify to add support for MFC, then copy this code into the cpp file and press compile. class CLogItem : public CObject { protected: virtual BOOL CheckConflict(CLogItem* pItem) const; }; struct MapEntry; //forward declaration.. typedef CArray<MapEntry, MapEntry&> CMapEntryArray;...

Numbers in a text field-can I add them up?
Hi everyone! Using A02 on XP. I have a table of data with survey response fields that contain a 0,1,2,3,4 or 5. However, the fields are formatted as text, not numbers. I need to add up certain blocks (Items 1-6, Items 7-23, etc.) and then do some averaging. I cannot change the field types from text. Must I append to a new table or can I do something right in my query? I've got one field in my query like this: ES: [Item1]+[Item2]+[Item3]+[Item4]+[Item5]+[Item6] My result is: 553453 or 554444, etc. I want: 25 or 22, etc. I would really appreciate any help or advice. Thanks...

Printing Multiple Copies #4
Hi all - I am using Vista Business and Publisher 2007 from the Office 2007 Small Business package. No matter what type of publication or template I use I can only print single copies. Most recently I tried to print 30 copies of a single page flyer and had to do it a single copy at a time. If I go to File|Print and set the number of copies to 30, I still get a single copy only. Does anyone have any thoughts? Thanks -- Andrew Aitchison (amhsn@nospam.sympatico.ca) Is your printer driver current? What is the default in the printing preferences in the control panel printer folder? ...

Help ! formatting data to text
I am creating data in an Excel spreadsheet. I then want to get that data into a simple text email. I have some problems and questions... 1) how do I get the columns of data to line up evenly when I copy the data to email text ? Keep in mind I need to be in simple text format, not HTML or rich text. Every time I do this, all columns become chaos and are unreadable. 2) Is there a simple way to automate the creation of an email from an excel file ? this is less important to me. Thanks in advance WxMachine #1. I think it may have to do with what email client you use, too. I copy and ...

suggestion needed !!!!!!!!!!
In my company the want to calculate phone calls done by each sales person at the end of the day. Please give me suggestion how to implement this. Mahain, A quick solution would be 1) Create an advance find view based on the criteria you are looking for ie. Activity of the type phone call, Status = completed 2) Export the list to Excel (Dynamic pivot table/worksheet) 3) If pivot : Drag and drop relavent fields 3) If worksheet: filter by date and use sum. The advantage of dynamic excel report is it updates itself when ever you open the sheet. Hope this is helpful Venkat http://venkatbendalam...

VISIO 2007 -Text direction
can some one tell me how to change text to be type in vertically. Under tools, options there is no regional tab or under format text the change text direction command does not work. "kgbrat" <kgbrat@discussions.microsoft.com> wrote in message news:2DBF18B5-E1C8-4493-8BEF-F7D4C1538781@microsoft.com... > can some one tell me how to change text to be type in vertically. Under > tools, options there is no regional tab or under format text the change > text > direction command does not work. You can use the Text Tool (The A with an circular arrow around it) and gr...

multiple revieve of emails
I recieve multiple copys of emails in outlook. In some cases I get 100 copys of the exact same message, in other cases it is ok, then others many times Only one message on server Jim <anonymous@discussions.microsoft.com> wrote: > I recieve multiple copys of emails in outlook. In some > cases I get 100 copys of the exact same message, in other > cases it is ok, then others many times Only one message on > server Usually caused by 1) Send/receive interval too small or 2) server timeout value too small or 3) rules that don't contain the "stop processing more rules...

Multiple Account Download from One Financial Instituition
Hi, I have at one brokerage mutliple accounts (individual, joint, 401K, roll-over etc). In Money they are all separate accounts. When I connect with the brokerage I am only able to connect to one type of account (in this case retirement). How can I download multiple accounts from a brokerage (when not all have the same URL). Please email me your reply. Thanks Sandeep ...

Integration Manager need a registration key for test company?
Hi all, Can anyone tell if I need the registration key for IM if I am doing some testings on Test company (World Online)? Also, can I specify the company database in IM for the data to import to? Please advise. Thanks You do not need a reg key for the Two Company, and if you are using the standard adapter the data will integrate into the Company that is open in Great Plains. You can Specify which database you want to integrate into by using the SQL Optimizer. You do not need great Plains open for this adapter. "Terry" wrote: > Hi all, > > Can anyone tell if I nee...

Enter multiple cash receipt payment methods in Cashbook/BM.
When entering a receipt into cashbook/bank management, there is sometimes a need to receipt the amount as more than one payment type - e.g. cash and cheque. This process is accommodated well in SOP. It would be useful to have this type of procedure included in Bank Management. This is a user request from Pan Pac Forest Products. ...

Count Unique Items with Multiple Criteria
I am trying to get a list of how many lots a particular car model is on. For example, say we have a spreadsheet that looks like: Model License Lot Ford xjd-394 1 Chevy gwg-394 2 Ford sdf-333 1 Ford lkj-111 3 Toyota skd-333 4 Toyota shk-584 4 I am loking for a way to get data that says how many unique lots each car is on, so for example: Ford: 2 Chevy: 1 Toyota: 1 I was trying to do this with Pivot tables and the count functionality, but it isn't quite getting me the results I want. I can get the results with a pivot table ...

Collecting multiple feeds
Folks, I am subscribed to about 30 radio podcast feeds. When I refresh them on any given day, there will be five or six that refresh, and on Friday, there are about twelve. For each one, I click the URL in the feed, which opens the site for that radio program. Then I right-click the link to the podcast and select Save Target As... As it all goes onto the same directory on an MP3 player, I don't have to select it each time, but when the download frame comes up, I have to click the Save button. As most of these programs come from the BBC site, which only allows two si...

Text in column causing SUMPRODUCT error
Greegings. I have a SUMPRODUCT formula that is having errors when one of the columns has text instead of a NULL or a number. If I delete the text cells in that column it works as desired. I'll give a simple example. Suppose I have the following in A1:B6.... a 1 a 2 a abc b 1 b 1 a 2 And I need this... =SUMPRODUCT(($A$1:$A$6="a")*($B$1:$B$6)) It errors out until I delete the "abc" in cell B3, then it works as desired. I tried to replace the "abc" with a 0 by trying this... =IF(ISNUMBER(B3)=FALSE,0,B3) And it works for that pa...

Z order in Visual Studio Dialog Editor
I have a dialog with a large Tab Control. On Top of that tab control are a few other bits and pieces. I keep ending up with the Tab Control on top of the other things, so I can't see them when modifying the layout of the dialog. I have a 'send to back' and 'bring to front' button on the Layout toolbar, but it isn't active when I have my Tab Control selected. I can't find another 'send to back' option. The option must be here somewhere - help?!? "GT" <ContactGT_remove_@hotmail.com> wrote in message news:468d1731$0$26278$c3e8da3@news...

Copy cell contents, then paste into the same cell with other text.
Hi! I tried a search first and couldn't find anything like this. My spreadsheet has a column for shipping that takes a series like this for each product: ?0.0*0.13.2*d*0x0x0:07:24:04 Following the question mark is the handling charge (0.0 in this example). This is followed by an * and then the weight of the item (0.13.2 in this example which is 13.2 ounces) I have a list of product weights in a colum with just pounds and ounces. I need to copy that information, then paste it into the weight area of the string above and then paste those modified contents back into t...

Help replacing text with Yes or No
I have a field formated as general. The field contains either 1 or is left blank. If the field has a 1 I want to replace it with Yes and if the field is blank I want to replace it with No. any help is appreciated. -- Jerry Save your data and use a copy for this exercize........... Assuming your data in Column A, put this in B1 and copy down........ =IF(A1=1,"Yes","No") Then highlight the column and do Copy > PasteSpecial > Values to get rid of the formulas..........then delete column A if you wish....... Vaya con Dios, Chuck, CABGx3 "Jerry Arnone, ...

help needed on multiple option buttons
Hi, I am trying to use option buttons in a few different locations in Excel. In one cell i want three options and three different buttons. In another locations, two options with their own two buttons. However, the 5 buttons act as 5 linked options, so i can only have one or another button selected at a time. I would like one of the first three selected and one of the next two and so on. Can anybody help me work out how to resolve this. Thanks, If you used optionbuttons from the Forms toolbar, put a nice groupbox (also from the forms toolbar) around each group. If you use optionbuttons ...

can i create a modalless dialog Box in the worker thread.
hi guys, is it possible to create a modalless dialog box in the worker thread, actually we have try this but we got error that is" you cannot create object with new operator in the worker thread " but i don't know what is the actual reason behind this. actually i am trying to create a modalless dialog box from main dialog box and i want to perform openGL programing on both the dialog box in such a manner so that they do not collapse or crash each other because at one time only one rendering device context should reside in the memory if we want to create more then one device con...