diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-22 23:09:21 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-22 23:09:21 +0400 |
commit | 3563f677f88baf7b1f68d7f435787e3bf4a20d24 (patch) | |
tree | 4469ba1fa6e0bcacb0dd4fb851a375c7f2da5321 /source/blender/blenfont | |
parent | 39fd8fa4002391b24d6154ba5489cf1a5a05f5bd (diff) |
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,
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/intern/blf_lang.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |