diff options
author | Damien Picard <pioverfour> | 2022-08-23 12:43:39 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-08-23 12:54:34 +0300 |
commit | 4ac96a483bf1567d37ec0357c5430c731c4f884e (patch) | |
tree | 376ced2dae9f4b288707574be1a84d7fdf4cbfda /source/blender/windowmanager/intern | |
parent | 22fdb88be525fbefb77c17fe69956e1e367c747e (diff) |
I18n: make workspaces translatable
This makes workspaces more translatable:
- New Workspace menu
- header
- preset menus
- preset entries
- workspace names upon factory file template load
- new workspace name upon workspace addition
To properly translate those names, an extraction function for
workspace names from app templates was added as well.
(Do not do anything when loading a user-saved file!)
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D15727
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index cbf492fc582..fd0e09be3b0 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -699,6 +699,13 @@ static void wm_file_read_post(bContext *C, const struct wmFileReadPost_Params *p } } + if (is_factory_startup && BLT_translate_new_dataname()) { + /* Translate workspace names */ + LISTBASE_FOREACH_MUTABLE (WorkSpace *, workspace, &bmain->workspaces) { + BKE_libblock_rename(bmain, &workspace->id, CTX_DATA_(BLT_I18NCONTEXT_ID_WORKSPACE, workspace->id.name + 2)); + } + } + if (use_data) { /* important to do before NULL'ing the context */ BKE_callback_exec_null(bmain, BKE_CB_EVT_VERSION_UPDATE); |