diff options
Diffstat (limited to 'src/Main/Resources.cpp')
-rw-r--r-- | src/Main/Resources.cpp | 25 |
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 } |