VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-09-09 01:16:27 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-09-10 01:44:09 +0200
commitc55e08b31e8100a593b4f81784489a820de807a1 (patch)
tree0fa78904e6ce22cf6fa94f74bd7357a31c371522 /src/Format
parent09db742c3e7e2d10bbef4619aff395d154386ee0 (diff)
downloadVeraCrypt-c55e08b31e8100a593b4f81784489a820de807a1.tar.gz
VeraCrypt-c55e08b31e8100a593b4f81784489a820de807a1.zip
Windows: When no language selected by user, explicitly use English as default one unless VeraCrypt is in portable mode.
Diffstat (limited to 'src/Format')
-rw-r--r--src/Format/Tcformat.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 2ebc70ca..d520a635 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -743,8 +743,21 @@ static void LoadSettingsAndCheckModified (HWND hwndDlg, BOOL bOnlyCheckModified,
if (bOnlyCheckModified)
{
char langid[6] = {0};
- StringCbCopyA (langid, sizeof(langid), GetPreferredLangId ());
- ConfigReadCompareString ("Language", "", langid, sizeof (langid), TRUE, pbSettingsModified);
+ if (!IsNonInstallMode ())
+ {
+ ConfigReadString ("Language", "", langid, sizeof (langid));
+ // when installed, if no preferred language set by user, English is selected default
+ if (langid [0] == 0)
+ StringCbCopyA (langid, sizeof(langid), "en");
+
+ if (pbSettingsModified && strcmp (langid, GetPreferredLangId ()))
+ *pbSettingsModified = TRUE;
+ }
+ else
+ {
+ StringCbCopyA (langid, sizeof(langid), GetPreferredLangId ());
+ ConfigReadCompareString ("Language", "", langid, sizeof (langid), TRUE, pbSettingsModified);
+ }
}
if (hwndDlg != NULL)
@@ -785,8 +798,7 @@ static void SaveSettings (HWND hwndDlg)
ConfigWriteInt ("SaveVolumeHistory", bHistory);
ConfigWriteString ("SecurityTokenLibrary", SecurityTokenLibraryPath[0] ? SecurityTokenLibraryPath : "");
- if (GetPreferredLangId () != NULL)
- ConfigWriteString ("Language", GetPreferredLangId ());
+ ConfigWriteString ("Language", GetPreferredLangId ());
ConfigWriteEnd (hwndDlg);
}