Click to See Complete Forum and Search --> : System strings in current language
ThomasSoeder
February 26th, 2003, 05:14 AM
Hello, I have the following question:
How can I find out the value of system strings like e. g. "Retry", "Abort",, "Cancel" ... in the language in which the system is currently running?
In a dialog, I want to set the text of the Cancel button (IDCANCEL) according to the user's language. My program shall run in several countries.
OK button is no problem, its text is always "OK".
But English "Cancel" is in German "Abbrechen", in French "Annuller" (?), and I don't know the Italian, Spanish or Czech word - but certainly the English / German / French / Italian / Spanish / Czech version of Windows knows it!
Thank you very much for help.
Mike Harnad
February 26th, 2003, 10:03 AM
If you're planning to check every dialog control/string and update it according to the user language, you might want to re-think your design. it would be a huge undertaking. There are definite steps to internationalize your software. You do not have to go it alone. Start with the MSDN article International Programming Topics.
ThomasSoeder
February 27th, 2003, 01:46 AM
It's not a huge undertaking because the program part I need the string for is only one small dialog, where I need the "Cancel" text in the user's language.
Unfortunately I didn't find anything useful in the MSDN (it deals with codepages, date time format, MBCS etc.), so I need your help.
If you call e. g. MessageBox(..., MB_YESNOCANCEL) , then Windows sets the caption of the YES button, the NO button and the CANCEL button to strings of the user's language.
How can I access these strings without calling MessageBox()?
Mike Harnad
February 27th, 2003, 11:38 AM
I believe those strings are stored like any other string. More than likely, they're tucked away in some Visual C++ release DLL or Windows DLL. You can access them IF you know from what DDL to load the string.
I guess I'm still confused as to what your goal is. If your software runs on a specific language version of Windows, why do you need to translate the strings?
ThomasSoeder
February 28th, 2003, 02:55 AM
Thank you for your answer.
I suppose as well that it can be found in a Windows DLL, but in which one???
Let me now explain why this problem encountered to me:
The dialog where I need the "Cancel" string is a little module in our library.
We use this library to build programs that are usually designed for several languages.
In most of our programs we use a library class (as a global variable) that manages national language support, but unfortunately not in all! In a few programs we don't use this class, and the global variable is NULL.
Therefore - since I don't know whether my dialog can access the global variable - I wished that my dialog class be independent of this global variable.
I hope that the problem is clear now.
ThomasSoeder
March 6th, 2003, 02:10 AM
Has nobody any ideas?
mkk
July 9th, 2003, 06:00 AM
for example use CFindReplaceDialog class
CFindReplaceDialog pFRDlg = new CFindReplaceDialog();
pFRDlg->Create( TRUE, "", "", FR_DOWN | FR_WHOLEWORD, this );
CString cCancel;
pFRDlg->GetDlgItem(IDCANCEL)->GetWindowText(cCancel);
// or
pFRDlg->GetDlgItemText(IDCANCEL, cCancel);
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.