From 3563f677f88baf7b1f68d7f435787e3bf4a20d24 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 22 Dec 2011 19:09:21 +0000 Subject: 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_.UTF-8 and it should work fine, --- source/blender/blenfont/intern/blf_lang.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/blenfont/intern') diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index 430780b19a0..71e4fba94f6 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -189,6 +189,12 @@ void BLF_lang_set(const char *str) 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; } -- cgit v1.2.3