Click here to Skip to main content
12,299,131 members (39,624 online)
Click here to Skip to main content

Stats

329.9K views
8.4K downloads
160 bookmarked
Posted

RC Localization Tool (LocalizeRC)

, 14 Jan 2004 BSD
A tool for localizing/translating Resource Scripts
LocalizeRC07.dll
LocalizeRC.exe
LocalizeRC07.dll
LocalizeRC.exe
LocalizeRC07.dll
LocalizeRC.exe
LocalizeRC.exe
LocalizeRC07.dll
res
LocalizeRC.ico
LocalizeRC.manifest
LocalizeRC.dsp
LocalizeRC.dsw
German
German.dsp
German.ini
German.lws
res
LocalizeRC.ico
LocalizeRC.manifest
LocalizeRC.dsw
LocalizeRC.ico
LocalizeRC.manifest
German.dsp
German.ini
German.lws
LocalizeRC.ico
LocalizeRC.manifest
LocalizeRC.dsp
LocalizeRC.ico
LocalizeRC.manifest
German.dsp
German.ini
German.lws
LocalizeRC.ico
LocalizeRC.manifest
LocalizeRC.dsp
LocalizeRC.dsw
German.dsp
German.ini
German.lws
LocalizeRC.ico
LocalizeRC.manifest
LocalizeRC.ico
LocalizeRC.manifest
LocalizeRC.dsp
LocalizeRC.dsw
LocalizeRC.ncb
LocalizeRC07.dll
LocalizeRC.exe
LocalizeRC.exe
LocalizeRC07.dll
LocalizeRC07.dll
LocalizeRC.exe
LocalizeRC07.dll
LocalizeRC.exe
// LocalizeRC.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "LocalizeRC.h"
#include "LocalizeRCDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CLocalizeRCApp

BEGIN_MESSAGE_MAP(CLocalizeRCApp, CWinApp)
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()


// CLocalizeRCApp construction

CLocalizeRCApp::CLocalizeRCApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}


// The one and only CLocalizeRCApp object

CLocalizeRCApp theApp;


// CLocalizeRCApp initialization

BOOL CLocalizeRCApp::InitInstance()
{
	// InitCommonControls() is required on Windows XP if an application
	// manifest specifies use of ComCtl32.dll version 6 or later to enable
	// visual styles.  Otherwise, any window creation will fail.
	InitCommonControls();

	//AfxEnableControlContainer(); no ActiveX support
	
	AfxInitRichEdit();

	CWinApp::InitInstance();

	SetRegistryKey(_T("LocalizeRC"));

	CurLangID = STANDARD_LANGID;

	if( !LoadLangIDDLL( static_cast<LANGID>( GetProfileInt( SEC_LASTPROJECT, ENT_LANGID, 0 ) )) )
		if( !LoadLangIDDLL(GetUserDefaultLangID()) )
			LoadLangIDDLL(GetSystemDefaultLangID());

	CLocalizeRCDlg dlg;
	dlg.LangID = CurLangID;

	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	if( CurLangID != STANDARD_LANGID )
		FreeLibrary( AfxGetResourceHandle() );

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

BOOL CLocalizeRCApp::LoadLangIDDLL(LANGID LangID)
{
	HINSTANCE hInstance;
	CString strLangIDDLL;
	
	if( LangID == STANDARD_LANGID )	// integrated language is the right one
		return true;
	
	strLangIDDLL.Format( _T("LocalizeRC%.2x.dll"), LangID );
	hInstance = LoadLibrary( strLangIDDLL );
	if( hInstance )
	{
		AfxSetResourceHandle( hInstance );
		CurLangID = LangID;
		return true;
	}
	return false;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The BSD License

Share

About the Author

Konrad Windszus
Web Developer
Germany Germany
Author of the shareware WinCD.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160525.2 | Last Updated 15 Jan 2004
Article Copyright 2003 by Konrad Windszus
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid