diff options
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/BLF_api.h | 1 | ||||
-rw-r--r-- | source/blender/blenfont/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 8 | ||||
-rwxr-xr-x | source/blender/blenfont/intern/blf_gettext.c | 40 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_lang.c | 10 |
5 files changed, 13 insertions, 47 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 6f6003fa670..837ca814fbf 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -34,7 +34,6 @@ #ifndef BLF_API_H #define BLF_API_H -#include <stdlib.h> struct rctf; int BLF_init(int points, int dpi); diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt index cc677d39b10..82099d4f125 100644 --- a/source/blender/blenfont/CMakeLists.txt +++ b/source/blender/blenfont/CMakeLists.txt @@ -40,7 +40,6 @@ set(SRC intern/blf.c intern/blf_dir.c intern/blf_font.c - intern/blf_gettext.c intern/blf_glyph.c intern/blf_lang.c intern/blf_util.c diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index c0e62b1c0c7..82094fdecdd 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -34,6 +34,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <libintl.h> #include <math.h> #include <ft2build.h> @@ -299,6 +300,13 @@ void BLF_enable(int fontid, int option) font->flags |= option; } +char* BLF_gettext(const char *msgid) +{ + if( msgid!=NULL && strlen(msgid)>0 ) + return gettext( msgid ); + return ""; +} + void BLF_disable(int fontid, int option) { FontBLF *font; diff --git a/source/blender/blenfont/intern/blf_gettext.c b/source/blender/blenfont/intern/blf_gettext.c deleted file mode 100755 index c82baed555c..00000000000 --- a/source/blender/blenfont/intern/blf_gettext.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * $Id: blf_gettext.c 37094 2011-06-02 11:22:22Z xiaoxiangquan $ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2008 Blender Foundation. - * All rights reserved. - * - * Contributor(s): Blender Foundation. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/blenfont/intern/blf_gettext.c - * \ingroup blf - */ - -#include <libintl.h> -#include <string.h> - -char* BLF_gettext(const char *msgid) -{ - if( msgid!=NULL && strlen(msgid)>0 ) - return gettext( msgid ); - return ""; -} diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index cc55eb585ed..28d1f57c619 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -140,8 +140,11 @@ void BLF_lang_set(const char *str) char *locreturn; if(str==NULL) str = lang_to_locale[U.language]; - BLI_setenv("LANG", str); - BLI_setenv("LANGUAGE", str); + if( str[0]!=0 ) + { + BLI_setenv("LANG", str); + BLI_setenv("LANGUAGE", str); + } locreturn= setlocale(LC_ALL, str); if (locreturn == NULL) { @@ -161,9 +164,6 @@ void BLF_lang_set(const char *str) bindtextdomain(DOMAIN_NAME, global_messagepath); /* bind_textdomain_codeset(DOMAIN_NAME, global_encoding_name); */ BLI_strncpy(global_language, str, sizeof(global_language)); - -// printf( "<<< %s %s %s \n", setlocale(LC_MESSAGES,NULL), getenv("LANG"), getenv("LANGUAGE") ); - } void BLF_lang_encoding(const char *str) |