mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-07-06 13:08:00 -05:00
Linux: fix language loading when running as AppImage
Fixes #1624 The language file path was hardcoded to /usr/share/veracrypt/languages/ which doesn't exist inside an AppImage runtime. Language files are actually located under $APPDIR/usr/share/veracrypt/languages/ when running from an AppImage. This affected both the language file loading in Resources.cpp and the language enumeration in PreferencesDialog.cpp, causing the language selection to show only "System default" and "English" regardless of which translations were packaged in the AppImage.
This commit is contained in:
@@ -22,6 +22,9 @@
|
||||
#include "Main/Main.h"
|
||||
#include "Main/Application.h"
|
||||
#include "Main/GraphicUserInterface.h"
|
||||
#ifdef TC_LINUX
|
||||
#include "Platform/Unix/Process.h"
|
||||
#endif
|
||||
#include "Volume/Cipher.h"
|
||||
#include "PreferencesDialog.h"
|
||||
|
||||
@@ -132,7 +135,16 @@ namespace VeraCrypt
|
||||
#if defined (TC_MACOSX)
|
||||
wxDir languagesFolder(StringConverter::ToSingle (Application::GetExecutableDirectory()) + "/../Resources/languages/");
|
||||
#else
|
||||
wxDir languagesFolder("/usr/share/veracrypt/languages/");
|
||||
wxString languagesFolderPath("/usr/share/veracrypt/languages/");
|
||||
#ifdef TC_LINUX
|
||||
if (Process::IsRunningUnderAppImage (StringConverter::ToSingle (wstring (Application::GetExecutablePath()))))
|
||||
{
|
||||
const char* appDirEnv = getenv ("APPDIR");
|
||||
if (appDirEnv)
|
||||
languagesFolderPath = wxString::FromUTF8 (appDirEnv) + "/usr/share/veracrypt/languages/";
|
||||
}
|
||||
#endif
|
||||
wxDir languagesFolder(languagesFolderPath);
|
||||
#endif
|
||||
wxArrayString langArray;
|
||||
LanguageListBox->Append("System default");
|
||||
|
||||
Reference in New Issue
Block a user