From 41ed84cbad00ab35b2edfde1fc221f3d7a58339e Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Thu, 2 Feb 2023 08:58:02 +0100 Subject: [PATCH] I18n: add disambiguation contexts After rBdb87e2a638f9, two contexts were missing: - VirtualReality, to be used in an add-on - Constraint, used in the constraints UI The latter was actually used without being added, which caused errors. It was reverted in rB31a640027982. --- release/scripts/startup/bl_ui/properties_constraint.py | 8 ++++---- source/blender/blentranslation/BLT_translation.h | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index 38e5f5719d4..0fa340c8d15 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -397,7 +397,7 @@ class ConstraintButtonsPanel: sub.prop(con, "invert_z", text="Z", toggle=True) row.label(icon='BLANK1') - layout.prop(con, "mix_mode", text="Mix") + layout.prop(con, "mix_mode", text="Mix", text_ctxt=i18n_contexts.constraint) self.space_template(layout, con) @@ -488,7 +488,7 @@ class ConstraintButtonsPanel: self.target_template(layout, con) layout.prop(con, "remove_target_shear") - layout.prop(con, "mix_mode", text="Mix") + layout.prop(con, "mix_mode", text="Mix", text_ctxt=i18n_contexts.constraint) self.space_template(layout, con) @@ -513,7 +513,7 @@ class ConstraintButtonsPanel: subsub.prop(con, "eval_time", text="") row.prop_decorator(con, "eval_time") - layout.prop(con, "mix_mode", text="Mix") + layout.prop(con, "mix_mode", text="Mix", text_ctxt=i18n_contexts.constraint) self.draw_influence(layout, con) @@ -1024,7 +1024,7 @@ class ConstraintButtonsSubPanel: col.prop(con, "to_min_z" + ext, text="Min") col.prop(con, "to_max_z" + ext, text="Max") - layout.prop(con, "mix_mode" + ext, text="Mix") + layout.prop(con, "mix_mode" + ext, text="Mix", text_ctxt=i18n_contexts.constraint) def draw_armature_bones(self, context): layout = self.layout diff --git a/source/blender/blentranslation/BLT_translation.h b/source/blender/blentranslation/BLT_translation.h index b85169fb03c..f788da8d429 100644 --- a/source/blender/blentranslation/BLT_translation.h +++ b/source/blender/blentranslation/BLT_translation.h @@ -126,6 +126,10 @@ const char *BLT_translate_do_new_dataname(const char *msgctxt, const char *msgid #define BLT_I18NCONTEXT_EDITOR_VIEW3D "View3D" #define BLT_I18NCONTEXT_EDITOR_FILEBROWSER "File browser" + /* Generic contexts. */ +#define BLT_I18NCONTEXT_VIRTUAL_REALITY "Virtual reality" +#define BLT_I18NCONTEXT_CONSTRAINT "Constraint" + /* Helper for bpy.app.i18n object... */ typedef struct { const char *c_id; @@ -190,6 +194,8 @@ typedef struct { BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "id_windowmanager"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_VIEW3D, "editor_view3d"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_FILEBROWSER, "editor_filebrowser"), \ + BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_VIRTUAL_REALITY, "virtual_reality"), \ + BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_CONSTRAINT, "constraint"), \ { \ NULL, NULL, NULL \ } \ -- 2.30.2