From 3b6c75dc318223a7e559805ed9802c46c73f2f28 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 29 Jul 2019 14:10:54 +0200 Subject: 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 --- source/blender/editors/space_file/filelist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/editors/space_file') 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) -- cgit v1.2.3