VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Resources.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2021-08-15 00:51:06 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2021-08-15 01:07:17 +0200
commit8ae5a715d66dcbc598017f262089165b762f42c5 (patch)
treed1067a8e36e94f246e494677e04ebebaa175febe /src/Main/Resources.cpp
parent33baca72616d7d78e7a31519ea608a8f493842d6 (diff)
downloadVeraCrypt-8ae5a715d66dcbc598017f262089165b762f42c5.tar.gz
VeraCrypt-8ae5a715d66dcbc598017f262089165b762f42c5.zip
MacOSX: First native Apple M1 support
Diffstat (limited to 'src/Main/Resources.cpp')
-rw-r--r--src/Main/Resources.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/Main/Resources.cpp b/src/Main/Resources.cpp
index 32bcd9d2..6ba63c52 100644
--- a/src/Main/Resources.cpp
+++ b/src/Main/Resources.cpp
@@ -14,16 +14,17 @@
#include "Platform/Platform.h"
#include "Resources.h"
-#ifdef TC_LINUX
+#ifdef TC_WINDOWS
+#include "Main/resource.h"
+#else
+#ifdef TC_MACOSX
+#include "Application.h"
+#endif
#include "Platform/File.h"
#include "Platform/StringConverter.h"
#include <stdio.h>
#endif
-#ifdef TC_WINDOWS
-#include "Main/resource.h"
-#endif
-
namespace VeraCrypt
{
@@ -54,13 +55,17 @@ namespace VeraCrypt
strBuf.Zero();
strBuf.CopyFrom (res);
return string (reinterpret_cast <char *> (strBuf.Ptr()));
-#elif TC_LINUX
+#else
// get language from env LANG
// support: C,POSIX,
// support for e.g. german: de_DE.UTF-8, de.UTF8, de_DE, de
// not support e.g.: de@Euro
string defaultLang("en");
+#if defined (TC_MACOSX)
+ string filenamePrefix = StringConverter::ToSingle (Application::GetExecutableDirectory()) + "/../Resources/languages/Language.";
+#else
string filenamePrefix("/usr/share/veracrypt/languages/Language.");
+#endif
string filenamePost(".xml");
string filename = filenamePrefix + defaultLang + filenamePost;
if(const char* env_p = getenv("LANG")){
@@ -127,14 +132,6 @@ namespace VeraCrypt
};
return string ((const char*) LanguageXml);
-#else
- static byte LanguageXml[] =
- {
-# include "Common/Language.xml.h"
- , 0
- };
-
- return string ((const char*) LanguageXml);
#endif
}