diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-07-29 15:10:54 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-07-29 15:11:35 +0300 |
commit | 3b6c75dc318223a7e559805ed9802c46c73f2f28 (patch) | |
tree | ef5de922cfbfcacb8e69ed7fd0290b53ccce2784 /source/blender/editors/space_file/filelist.c | |
parent | b83a1b62c7db4e11c96b65cb68b2a88eeab7fcbc (diff) |
Fix T67620: Font preview translations malfunction in Blender 2.8
We cannot reliably use translations API from non-main threads.
Now storing translated strings in a static cache, with basic mechanism
to update it on language change.
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D5350
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 9004eaa7bf6..e06ee620ea7 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1317,6 +1317,9 @@ static void filelist_cache_init(FileListEntryCache *cache, size_t cache_size) cache->size = cache_size; cache->flags = FLC_IS_INIT; + + /* We cannot translate from non-main thread, so init translated strings once from here. */ + IMB_thumb_ensure_translations(); } static void filelist_cache_free(FileListEntryCache *cache) |