print number of overwritten strings
This commit is contained in:
@@ -328,7 +328,7 @@ static LocalizedString ERROR_PARSING_FILE ( "LanguagesDlg", "Error parsing fil
|
|||||||
static LocalizedString IMPORTING_THESE_STRINGS_WILL_OVERRIDE ( "LanguagesDlg", "Importing these strings will override all data in '%s'. Continue?" );
|
static LocalizedString IMPORTING_THESE_STRINGS_WILL_OVERRIDE ( "LanguagesDlg", "Importing these strings will override all data in '%s'. Continue?" );
|
||||||
static LocalizedString ERROR_READING ( "LanguagesDlg", "Error reading '%s'." );
|
static LocalizedString ERROR_READING ( "LanguagesDlg", "Error reading '%s'." );
|
||||||
static LocalizedString ERROR_READING_EACH_LINE_MUST_HAVE ( "LanguagesDlg", "Error reading line '%s' from '%s': Each line must have either 3 or 4 values. This row has %d values." );
|
static LocalizedString ERROR_READING_EACH_LINE_MUST_HAVE ( "LanguagesDlg", "Error reading line '%s' from '%s': Each line must have either 3 or 4 values. This row has %d values." );
|
||||||
static LocalizedString IMPORTED_STRINGS_INTO ( "LanguagesDlg", "Imported %d strings into '%s'. %d empty strings were ignored." );
|
static LocalizedString IMPORTED_STRINGS_INTO ( "LanguagesDlg", "Imported %d strings into '%s'. %d were overwritten. %d empty strings were ignored." );
|
||||||
void LanguagesDlg::OnBnClickedButtonImport()
|
void LanguagesDlg::OnBnClickedButtonImport()
|
||||||
{
|
{
|
||||||
// TODO: Add your control notification handler code here
|
// TODO: Add your control notification handler code here
|
||||||
@@ -380,6 +380,7 @@ void LanguagesDlg::OnBnClickedButtonImport()
|
|||||||
|
|
||||||
int iNumImported = 0;
|
int iNumImported = 0;
|
||||||
int iNumIgnored = 0;
|
int iNumIgnored = 0;
|
||||||
|
int iNumOverwritten = 0;
|
||||||
FOREACH_CONST( CsvFile::StringVector, csv.m_vvs, line )
|
FOREACH_CONST( CsvFile::StringVector, csv.m_vvs, line )
|
||||||
{
|
{
|
||||||
int iLineIndex = line - csv.m_vvs.begin();
|
int iLineIndex = line - csv.m_vvs.begin();
|
||||||
@@ -409,13 +410,18 @@ void LanguagesDlg::OnBnClickedButtonImport()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
RString sThrowAway;
|
||||||
|
bool bExists = ini.GetValue( tl.sSection, tl.sID, sThrowAway );
|
||||||
|
if( bExists )
|
||||||
|
iNumOverwritten++;
|
||||||
|
|
||||||
ini.SetValue( tl.sSection, tl.sID, tl.sCurrentLanguage );
|
ini.SetValue( tl.sSection, tl.sID, tl.sCurrentLanguage );
|
||||||
iNumImported++;
|
iNumImported++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ini.WriteFile(sLanguageFile) )
|
if( ini.WriteFile(sLanguageFile) )
|
||||||
Dialog::OK( ssprintf(IMPORTED_STRINGS_INTO.GetValue(),iNumImported,sLanguageFile.c_str(),iNumIgnored) );
|
Dialog::OK( ssprintf(IMPORTED_STRINGS_INTO.GetValue(),iNumImported,sLanguageFile.c_str(),iNumOverwritten,iNumIgnored) );
|
||||||
else
|
else
|
||||||
Dialog::OK( ssprintf(FAILED_TO_SAVE.GetValue(),sLanguageFile.c_str()) );
|
Dialog::OK( ssprintf(FAILED_TO_SAVE.GetValue(),sLanguageFile.c_str()) );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user