Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--projectfiles/blender/ftfont/FTF_ftfont.dsp2
-rw-r--r--source/blender/ftfont/intern/FTF_TTFont.cpp60
-rw-r--r--source/blender/ftfont/intern/FTF_TTFont.h2
3 files changed, 48 insertions, 16 deletions
diff --git a/projectfiles/blender/ftfont/FTF_ftfont.dsp b/projectfiles/blender/ftfont/FTF_ftfont.dsp
index e898af031b5..5f7fdc0fd15 100644
--- a/projectfiles/blender/ftfont/FTF_ftfont.dsp
+++ b/projectfiles/blender/ftfont/FTF_ftfont.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Target_Dir ""
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../source\blender\makesdna" /I "../../../source\blender\blenloader" /I "../../../../lib/windows/ftgl/include" /I "../../../../lib/windows/freetype/include" /I "../../../lib/windows/iconv/include" /I "../../../../lib/windows/gettext/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "WCHAR_T16" /D "HAVE_LC_MESSAGES" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../source\blender\makesdna" /I "../../../source\blender\blenloader" /I "../../../source\blender\blenlib" /I "../../../../lib/windows/ftgl/include" /I "../../../../lib/windows/freetype/include" /I "../../../lib/windows/iconv/include" /I "../../../../lib/windows/gettext/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "WCHAR_T16" /D "HAVE_LC_MESSAGES" /YX /FD /c
# ADD BASE RSC /l 0x411 /d "NDEBUG"
# ADD RSC /l 0x411 /d "NDEBUG"
BSC32=bscmake.exe
diff --git a/source/blender/ftfont/intern/FTF_TTFont.cpp b/source/blender/ftfont/intern/FTF_TTFont.cpp
index 186491d921a..819d5e8ef66 100644
--- a/source/blender/ftfont/intern/FTF_TTFont.cpp
+++ b/source/blender/ftfont/intern/FTF_TTFont.cpp
@@ -39,6 +39,7 @@
#include <string.h>
#include <locale.h>
#include "libintl.h"
+#include "BLI_blenlib.h"
#ifdef __APPLE__
#include <libgen.h>
@@ -49,7 +50,6 @@
#include "FTF_TTFont.h"
#define DOMAIN_NAME "blender"
-#define MESSAGE_FILE "message"
#define SYSTEM_ENCODING_DEFAULT "UTF-8"
#define FONT_SIZE_DEFAULT 12
@@ -103,9 +103,50 @@ int utf8towchar(wchar_t *w, char *c)
FTF_TTFont::FTF_TTFont(void)
{
+#ifdef __APPLE__
+ char tmp[1024];
+#endif
+
font=NULL;
font_size=FONT_SIZE_DEFAULT;
strcpy(encoding_name, SYSTEM_ENCODING_DEFAULT);
+
+ //set messagepath directory
+
+#ifndef LOCALEDIR
+#define LOCALEDIR "/usr/share/locale"
+#endif
+
+ BLI_make_file_string("/", messagepath, BLI_gethome(), ".blender/locale");
+printf("1. %s\n", messagepath);
+ if (BLI_exist(messagepath) == NULL) { // locale not in home dir
+
+ strcpy(messagepath, ".blender/locale");
+printf("2. %s\n", messagepath);
+ if(BLI_exist(messagepath) == NULL) { // locale not in current dir
+
+ strcpy(messagepath, LOCALEDIR);
+printf("3. %s\n", messagepath);
+ if(BLI_exist(messagepath) == NULL) { // locale not in LOCALEDIR
+
+
+#ifdef __APPLE__
+ /* message catalogs are stored inside the application bundle */
+ strcpy(tmp, dirname(bprogname));
+ strcat(tmp, "/../Resources/message");
+ realpath(tmp, messagepath);
+printf("4. %s\n", messagepath);
+ if(BLI_exist(messagepath) == NULL) { // locale not in bundle dir
+#endif
+
+ strcpy(messagepath, "message"); // old compatibility as last
+printf("5. %s\n", messagepath);
+ }
+#ifdef __APPLE__
+ } // heh
+#endif
+ }
+ }
}
@@ -142,10 +183,6 @@ int FTF_TTFont::SetFont(char* str, int size)
void FTF_TTFont::SetLanguage(char* str)
{
-#ifdef __APPLE__
- char tmp[1024];
- char msgpath[1024];
-#endif
#if defined (_WIN32) || defined(__APPLE__)
char envstr[12];
@@ -169,17 +206,10 @@ void FTF_TTFont::SetLanguage(char* str)
setlocale(LC_NUMERIC, "C");
#endif
-#ifdef __APPLE__
- /* message catalogs are stored inside the application bundle */
- strcpy(tmp, dirname(bprogname));
- strcat(tmp, "/../Resources/message");
- realpath(tmp, msgpath);
- bindtextdomain(DOMAIN_NAME, msgpath);
- textdomain(DOMAIN_NAME);
-#else
- bindtextdomain(DOMAIN_NAME, MESSAGE_FILE);
+
+ bindtextdomain(DOMAIN_NAME, messagepath);
textdomain(DOMAIN_NAME);
-#endif
+
strcpy(language, str);
}
diff --git a/source/blender/ftfont/intern/FTF_TTFont.h b/source/blender/ftfont/intern/FTF_TTFont.h
index c42685c2221..9492e326a7e 100644
--- a/source/blender/ftfont/intern/FTF_TTFont.h
+++ b/source/blender/ftfont/intern/FTF_TTFont.h
@@ -91,6 +91,8 @@ public:
void SetEncoding(char* str);
protected:
+ char messagepath[1024];
+
char language[32];
char encoding_name[32];
char font_name[128];