[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51465] trunk/blender/source/blender/ blenfont/intern/blf_lang.c: Atempt to get rid of those ugly "long locales" under windows.

Bastien Montagne montagne29 at wanadoo.fr
Sat Oct 20 21:54:11 CEST 2012


Revision: 51465
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51465
Author:   mont29
Date:     2012-10-20 19:54:09 +0000 (Sat, 20 Oct 2012)
Log Message:
-----------
Atempt to get rid of those ugly "long locales" under windows. Tested by me (win7 64, VC2008) and by Sergey. However, older OS (XP) may not work...

The idea behind this is that gettext lib has a func that mimics usual setlocale, but doing also the conversion to windows locale names. Let's hope it works everywhere!

Modified Paths:
--------------
    trunk/blender/source/blender/blenfont/intern/blf_lang.c

Modified: trunk/blender/source/blender/blenfont/intern/blf_lang.c
===================================================================
--- trunk/blender/source/blender/blenfont/intern/blf_lang.c	2012-10-20 19:36:08 UTC (rev 51464)
+++ trunk/blender/source/blender/blenfont/intern/blf_lang.c	2012-10-20 19:54:09 UTC (rev 51465)
@@ -42,10 +42,6 @@
 
 #include <locale.h>
 
-#if defined(_WIN32)
-#include <windows.h>
-#endif
-
 #include "libintl.h"
 
 #include "DNA_userdef_types.h"
@@ -182,8 +178,6 @@
 
 #if defined(_WIN32) && !defined(FREE_WINDOWS)
 	{
-		const char *long_locale = locales[2 * U.language];
-
 		if (short_locale) {
 			char *envStr;
 
@@ -196,11 +190,11 @@
 			MEM_freeN(envStr);
 		}
 
-		locreturn = setlocale(LC_ALL, long_locale);
+		locreturn = setlocale(LC_ALL, short_locale);
 
 		if (locreturn == NULL) {
 			if (G.debug & G_DEBUG)
-				printf("Could not change locale to %s\n", long_locale);
+				printf("Could not change locale to %s\n", short_locale);
 
 			ok = 0;
 		}




More information about the Bf-blender-cvs mailing list