15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Translating Microsoft DDV verification strings into German

Dennis Krabbe -- dkrabbe@ctcusa.com
Friday, December 13, 1996

Environment: VC 4.0 / 4.2b, Win 95, NT 3.51 / 40

I am trying to get my application under the German Language, meaning
all text (strings, dialogs, etc.) are translated to German.  I have my
resources (dialogs, strings, etc.) translated and reside in a resource
only DLL.  I am running my application under Windows 95 - German.  All
is fine with the exception of strings that Microsoft builds.

What I mean exactly is the following. I have a validation on an integer
that
I set with 
	DDV_MinMaxUInt(pDX, m_station, 0, 376);
in the DoDataExchange. If the validation fails, the message 
	'Please enter an integer between 0 and 376.'
is displayed in a dialog box with an OK button.  This message is not in my
resource.  It was created by Microsoft.  However, when running under
Windows
95 - German, the message remains in English.  The standard print dialogs
and
find/replace dialogs are all in German.

What do I need to do to get this string translated?

I have July MSDN.

Complete source for this module is below.

Thank you,

Dennis


--- HEADER FILE
----------------------------------------------------------------------------
-----

#include "resource.h"
////////////////////////////////////////////////////////////////////////////
/
// CxAddStation dialog

class CxAddStation : public CDialog
{
// Construction
public:
	CxAddStation(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CxAddStation)
	enum { IDD = IDD_ADDSTATION };
	UINT	m_station;
	//}}AFX_DATA



// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CxAddStation)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CxAddStation)
	virtual void OnOK();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

-- SOURCE FILE
----------------------------------------------------------------------------
-----------------

#include "stdafx.h"
#include "dvr.h"
#include "addstat.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

////////////////////////////////////////////////////////////////////////////
/
// CxAddStation dialog


CxAddStation::CxAddStation(CWnd* pParent /*=NULL*/)
	: CDialog(CxAddStation::IDD, pParent)
{
	//{{AFX_DATA_INIT(CxAddStation)
	m_station = 0;
	//}}AFX_DATA_INIT
}


void CxAddStation::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CxAddStation)
	DDX_Text(pDX, IDC_STATEDIT, m_station);
	DDV_MinMaxUInt(pDX, m_station, 0, 376);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CxAddStation, CDialog)
	//{{AFX_MSG_MAP(CxAddStation)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


////////////////////////////////////////////////////////////////////////////
/
// CxAddStation message handlers

void CxAddStation::OnOK() 
{
	// TODO: Add extra validation here
	
	char temp[9];
	GetDlgItemText(IDC_STATEDIT,temp,8);
	CString test(temp);
	if (test.FindOneOf("89") != -1)
		AfxMessageBox(IDS_ADDSTAT_OCTAL,MB_OK|MB_ICONEXCLAMATION);
	else
		CDialog::OnOK();
}





Tim Robinson -- timtroyr@ionet.net
Friday, December 20, 1996

Look in your .rc file for your project.  There is a reference to
"afxres.rc".  That file needs to be in German... or rather, replaced by one
that's in German.  I don't think you particularaly want to mangle that file.
Kick around in your .rc file and I think you'll see what to do.  If there's
an automated way to do it from the development environment, I don't know it.
I've not actually done anything multi-lingual under Windows 95, but was
semi-fun under 3.1x.  Good luck.

At 16:54 12/13/96 -0500, Dennis Krabbe wrote:
>Environment: VC 4.0 / 4.2b, Win 95, NT 3.51 / 40
>
>I am trying to get my application under the German Language, meaning
>all text (strings, dialogs, etc.) are translated to German.  I have my
>resources (dialogs, strings, etc.) translated and reside in a resource
>only DLL.  I am running my application under Windows 95 - German.  All
>is fine with the exception of strings that Microsoft builds.
>
>What I mean exactly is the following. I have a validation on an integer
>that
>I set with 
>	DDV_MinMaxUInt(pDX, m_station, 0, 376);
>in the DoDataExchange. If the validation fails, the message 
>	'Please enter an integer between 0 and 376.'
>is displayed in a dialog box with an OK button.  This message is not in my
>resource.  It was created by Microsoft.  However, when running under
>Windows
>95 - German, the message remains in English.  The standard print dialogs
>and
>find/replace dialogs are all in German.
>
>What do I need to do to get this string translated?
>
>I have July MSDN.
>
>Complete source for this module is below.
>
>Thank you,
>
>Dennis
>
>
>--- HEADER FILE
>----------------------------------------------------------------------------
>-----
>
>#include "resource.h"
>////////////////////////////////////////////////////////////////////////////
>/
>// CxAddStation dialog
>
>class CxAddStation : public CDialog
>{
>// Construction
>public:
>	CxAddStation(CWnd* pParent = NULL);   // standard constructor
>
>// Dialog Data
>	//{{AFX_DATA(CxAddStation)
>	enum { IDD = IDD_ADDSTATION };
>	UINT	m_station;
>	//}}AFX_DATA
>
>
>
>// Overrides
>	// ClassWizard generated virtual function overrides
>	//{{AFX_VIRTUAL(CxAddStation)
>	protected:
>	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
>	//}}AFX_VIRTUAL
>
>// Implementation
>protected:
>
>	// Generated message map functions
>	//{{AFX_MSG(CxAddStation)
>	virtual void OnOK();
>	//}}AFX_MSG
>	DECLARE_MESSAGE_MAP()
>};
>
>-- SOURCE FILE
>----------------------------------------------------------------------------
>-----------------
>
>#include "stdafx.h"
>#include "dvr.h"
>#include "addstat.h"
>
>#ifdef _DEBUG
>#undef THIS_FILE
>static char BASED_CODE THIS_FILE[] = __FILE__;
>#endif
>
>////////////////////////////////////////////////////////////////////////////
>/
>// CxAddStation dialog
>
>
>CxAddStation::CxAddStation(CWnd* pParent /*=NULL*/)
>	: CDialog(CxAddStation::IDD, pParent)
>{
>	//{{AFX_DATA_INIT(CxAddStation)
>	m_station = 0;
>	//}}AFX_DATA_INIT
>}
>
>
>void CxAddStation::DoDataExchange(CDataExchange* pDX)
>{
>	CDialog::DoDataExchange(pDX);
>	//{{AFX_DATA_MAP(CxAddStation)
>	DDX_Text(pDX, IDC_STATEDIT, m_station);
>	DDV_MinMaxUInt(pDX, m_station, 0, 376);
>	//}}AFX_DATA_MAP
>}
>
>
>BEGIN_MESSAGE_MAP(CxAddStation, CDialog)
>	//{{AFX_MSG_MAP(CxAddStation)
>	//}}AFX_MSG_MAP
>END_MESSAGE_MAP()
>
>
>////////////////////////////////////////////////////////////////////////////
>/
>// CxAddStation message handlers
>
>void CxAddStation::OnOK() 
>{
>	// TODO: Add extra validation here
>	
>	char temp[9];
>	GetDlgItemText(IDC_STATEDIT,temp,8);
>	CString test(temp);
>	if (test.FindOneOf("89") != -1)
>		AfxMessageBox(IDS_ADDSTAT_OCTAL,MB_OK|MB_ICONEXCLAMATION);
>	else
>		CDialog::OnOK();
>}
>
>
>
>
| Tim Robinson, Esquire          | Liberty  means responsibility. |
| timtroyr@ionet.net             | That is why most men dread it. |
| http://www.ionet.net/~timtroyr |            George Bernard Shaw |




bop@gandalf.se
Tuesday, December 24, 1996

> From Tim Robinson  
> Look in your .rc file for your project.  There is a reference to
> "afxres.rc".  That file needs to be in German... or rather, replaced by one
> that's in German.  I don't think you particularaly want to mangle that file.
> Kick around in your .rc file and I think you'll see what to do.  If there's
> an automated way to do it from the development environment, I don't know it.
> I've not actually done anything multi-lingual under Windows 95, but was
> semi-fun under 3.1x.  Good luck.
> 
> At 16:54 12/13/96 -0500, Dennis Krabbe wrote:
> >Environment: VC 4.0 / 4.2b, Win 95, NT 3.51 / 40
> >
> >I am trying to get my application under the German Language, meaning
> >all text (strings, dialogs, etc.) are translated to German.  I have my
> >resources (dialogs, strings, etc.) translated and reside in a resource
> >only DLL.  I am running my application under Windows 95 - German.  All
> >is fine with the exception of strings that Microsoft builds.
> >

In my installation I find the German resources (.rc) in the directory
MSDEV\MFC\include\l.deu

If you build a German version of your program with _statically_
_linked_  libraries, I am sure you will get all the resources in
German. 

If you use shared libraries, you must install a German version of
these libraries in your Windows\System directory. Otherwise
you will be using the default english versions.


Bo Persson
bop@gandalf.se




| Вернуться в корень Архива |