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.
This commit is contained in:
2023-02-02 08:58:02 +01:00
committed by Bastien Montagne
parent f2121d94bb
commit c7611d61e8
2 changed files with 10 additions and 4 deletions

View File

@@ -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

View File

@@ -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 \
} \