[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42830] trunk/blender/source/blender/ blenfont/intern/blf_lang.c: Fix #29494: Problem loading translations at Blender's startup

Sergey Sharybin sergey.vfx at gmail.com
Thu Dec 22 20:09:27 CET 2011


Revision: 42830
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42830
Author:   nazgul
Date:     2011-12-22 19:09:21 +0000 (Thu, 22 Dec 2011)
Log Message:
-----------
Fix #29494: Problem loading translations at Blender's startup

Problem was caused by trying to set locale to short named "es" locale
which failed. It's not really obvious which full locale name should
be used here (there are plenty of dialects), so rather than keeping
locale stuff on state when both of locale and utf-8 locale names
failed, restore default settings (restore environment variables and
use default locale for gettext).

This will resolve cases when spanish language is native on the system,
but it will fail in cases when somebody will want to have spanish
interface in non-spanish system. This might be worked around by setting
LANG and LANGUAGE environment variables to es_<dialect>.UTF-8 and it
should work fine,

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	2011-12-22 18:25:59 UTC (rev 42829)
+++ trunk/blender/source/blender/blenfont/intern/blf_lang.c	2011-12-22 19:09:21 UTC (rev 42830)
@@ -189,6 +189,12 @@
 
 			if (locreturn == NULL) {
 				printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
+
+				/* fallback to default settings */
+				locreturn= setlocale(LC_ALL, "");
+				BLI_setenv("LANG", default_locale);
+				BLI_setenv("LANGUAGE", default_locale);
+
 				ok= 0;
 			}
 




More information about the Bf-blender-cvs mailing list