diff options
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/Dlgcode.c | 17 | ||||
-rw-r--r-- | src/Common/Language.c | 4 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index dc727ee9..e858c3b4 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -2421,8 +2421,21 @@ void InitApp (HINSTANCE hInstance, char *lpszCommandLine) SetPreferredLangId (ConfigReadString ("Language", "", langId, sizeof (langId)));
if (langId[0] == 0)
- DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_LANGUAGE), NULL,
- (DLGPROC) LanguageDlgProc, (LPARAM) 1);
+ {
+ if (IsNonInstallMode ())
+ {
+ // only support automatic use of a language file in portable mode
+ // this is achieved by placing a unique language XML file in the same
+ // place as portable VeraCrypt binaries.
+ DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_LANGUAGE), NULL,
+ (DLGPROC) LanguageDlgProc, (LPARAM) 1);
+ }
+ else
+ {
+ // when installed, force using English as default language
+ SetPreferredLangId ("en");
+ }
+ }
LoadLanguageFile ();
diff --git a/src/Common/Language.c b/src/Common/Language.c index fb20a6fb..e6abd38d 100644 --- a/src/Common/Language.c +++ b/src/Common/Language.c @@ -35,10 +35,10 @@ BOOL LocalizationActive;
int LocalizationSerialNo;
-wchar_t UnknownString[1024];
+wchar_t UnknownString[1024] = {0};
static char *LanguageFileBuffer = NULL;
static HANDLE LanguageFileFindHandle = INVALID_HANDLE_VALUE;
-static char PreferredLangId[6];
+static char PreferredLangId[6] = {0};
static char *LanguageResource = NULL;
static DWORD LanguageResourceSize = 0;
static char *HeaderResource[2] = {NULL, NULL};
|