Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Issue #1: program tried to write missing translations to file c… #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// static int g_nReportMissing = QueryModuleDebugLevel( _T( "ReportMissingLangIDs" ) );
static int g_nReportMissing = TRUE;
// QueryModuleDebugLevel( _T( "ReportMissingLangIDs" ) );
static TCHAR missingTxtPath[_MAX_PATH + 1];

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
Expand All @@ -52,8 +53,13 @@ CLanguage::CLanguage()
m_dwCodePageID = 1252; // STANDARD CODE PAGE ANSI INTERNATIONAL
m_dwSubLangID = SUBLANG_DEFAULT;
m_dwLangID = LANG_ENGLISH;

memset(missingTxtPath, 0, _MAX_PATH + 1);
GetTempPath(_MAX_PATH, missingTxtPath);
_tcsncat(missingTxtPath, _T("missing.txt"), _MAX_PATH);
}


CLanguage::~CLanguage()
{
}
Expand Down Expand Up @@ -84,7 +90,7 @@ void CLanguage::ReportMissingID( int nID, const CUString& strEnglish, int nType

EncodeTab( strWrite );

if ( cFile.Open( _T( "c:\\temp\\missing.txt" ),
if ( cFile.Open(missingTxtPath,
CFile::modeReadWrite | CFile::modeNoTruncate | CFile::modeCreate ) )
{
while ( cFile.ReadString( strRead ) )
Expand Down Expand Up @@ -136,7 +142,7 @@ void CLanguage::ReportChangedID( int nID, const CUString& strResource, const CUS

EncodeTab( strWrite );

if ( cFile.Open( _T( "c:\\temp\\missing.txt" ),
if ( cFile.Open( missingTxtPath,
CFile::modeReadWrite | CFile::modeNoTruncate | CFile::modeCreate ) )
{
while ( cFile.ReadString( strRead ) )
Expand Down