I18n: disambiguate a few messages

- Active Track (NLA vs movie clip)
- New (file)
- Object Index (loop cut)
- Object Index (render pass)
- Proxy Storage (sequence)
- Rim (Solidify modifier)
- Roughness (particle children)
- Spaces (text whitespace)
- Out (sequencer wipe transition)

Also make new asset tag name translatable.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D16067
This commit is contained in:
Damien Picard 2022-10-05 17:53:28 +02:00 committed by Bastien Montagne
parent 860a539fb5
commit f5d67f3fdf
Notes: blender-bot 2023-02-14 06:57:56 +01:00
Referenced by commit 247af8cf5b, UI Translations: Add context to 'New' menu entries for files.
Referenced by commit 68ea6c85ab, Fix: File context menu broken after recent commit
Referenced by commit a096248d12, Fix: File menu broken after recent commit
11 changed files with 31 additions and 10 deletions

View File

@ -4,6 +4,9 @@ from __future__ import annotations
import bpy
from bpy.types import Operator
from bpy.app.translations import pgettext_data as data_
from bpy_extras.asset_utils import (
SpaceAssetInfo,
)
@ -33,7 +36,7 @@ class ASSET_OT_tag_add(AssetBrowserMetadataOperator, Operator):
def execute(self, context):
active_asset = SpaceAssetInfo.get_active_asset(context)
active_asset.tags.new("Tag")
active_asset.tags.new(data_("Tag"))
return {'FINISHED'}

View File

@ -3,7 +3,10 @@ import bpy
from bpy.types import Menu, Panel, UIList
from bl_ui.utils import PresetPanel
from bpy.app.translations import pgettext_tip as tip_
from bpy.app.translations import (
contexts as i18n_contexts,
pgettext_tip as tip_,
)
class RENDER_PT_format_presets(PresetPanel, Panel):

View File

@ -1679,7 +1679,7 @@ class PARTICLE_PT_children_roughness(ParticleButtonsPanel, Panel):
if part.use_roughness_curve:
sub = col.column()
sub.template_curve_mapping(part, "roughness_curve")
sub.prop(part, "roughness_1", text=iface_("Roughness", i18n_contexts.id_particlesettings))
sub.prop(part, "roughness_1", text="Roughness", text_ctxt=i18n_contexts.id_particlesettings)
sub.prop(part, "roughness_1_size", text="Size")
else:
sub = col.column(align=True)

View File

@ -2,7 +2,10 @@
import bpy
from bpy.types import Header, Menu, Panel
from bpy.app.translations import pgettext_iface as iface_
from bpy.app.translations import (
pgettext_iface as iface_,
contexts as i18n_contexts,
)
class TOPBAR_HT_upper_bar(Header):
@ -269,7 +272,9 @@ class TOPBAR_MT_file(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_AREA'
layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
layout.menu("TOPBAR_MT_file_new", text="New",
text_context=i18n_contexts.id_windowmanager,
icon='FILE_NEW')
layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
layout.menu("TOPBAR_MT_file_open_recent")
layout.operator("wm.revert_mainfile")
@ -724,7 +729,7 @@ class TOPBAR_MT_file_context_menu(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_AREA'
layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
layout.menu("TOPBAR_MT_file_new", text="New", text_context=i18n_contexts.id_windowmanager, icon='FILE_NEW')
layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
layout.separator()

View File

@ -763,6 +763,7 @@ void MESH_OT_loopcut(wmOperatorType *ot)
/* For redo only. */
prop = RNA_def_int(ot->srna, "object_index", -1, -1, INT_MAX, "Object Index", "", 0, INT_MAX);
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MESH);
RNA_def_property_flag(prop, PROP_HIDDEN);
prop = RNA_def_int(ot->srna, "edge_index", -1, -1, INT_MAX, "Edge Index", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_HIDDEN);

View File

@ -1207,6 +1207,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Track", "Active NLA Track");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ACTION);
/* XXX: should (but doesn't) update the active track in the NLA window */
RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_SELECTED, NULL);
}

View File

@ -4617,6 +4617,7 @@ void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool sce
prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SCENE);
if (scene) {
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
}

View File

@ -2893,6 +2893,7 @@ static void rna_def_wipe(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "forward");
RNA_def_property_enum_items(prop, wipe_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Wipe direction");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SEQUENCE);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);

View File

@ -231,6 +231,7 @@ static void rna_def_text(BlenderRNA *brna)
prop = RNA_def_property(srna, "indentation", PROP_ENUM, PROP_NONE); /* as an enum */
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
RNA_def_property_enum_items(prop, indentation_items);
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_TEXT);
RNA_def_property_ui_text(prop, "Indentation", "Use tabs or spaces for indentation");
prop = RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE);

View File

@ -13,6 +13,8 @@
#include "BKE_node_tree_update.h"
#include "BKE_tracking.h"
#include "BLT_translation.h"
#include "RNA_access.h"
#include "RNA_define.h"
@ -2197,6 +2199,7 @@ static void rna_def_trackingTracks(BlenderRNA *brna)
prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data object");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MOVIECLIP);
}
static void rna_def_trackingPlaneTracks(BlenderRNA *brna)
@ -2257,6 +2260,7 @@ static void rna_def_trackingObjectTracks(BlenderRNA *brna)
prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data object");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MOVIECLIP);
}
static void rna_def_trackingObjectPlaneTracks(BlenderRNA *brna)
@ -2278,6 +2282,7 @@ static void rna_def_trackingObjectPlaneTracks(BlenderRNA *brna)
NULL);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data object");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MOVIECLIP);
}
static void rna_def_trackingObject(BlenderRNA *brna)

View File

@ -108,7 +108,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemR(layout, ptr, "use_even_offset", 0, NULL, ICON_NONE);
}
col = uiLayoutColumnWithHeading(layout, false, IFACE_("Rim"));
col = uiLayoutColumnWithHeading(layout, false, CTX_IFACE_(BLT_I18NCONTEXT_ID_MESH, "Rim"));
uiItemR(col, ptr, "use_rim", 0, IFACE_("Fill"), ICON_NONE);
sub = uiLayoutColumn(col, false);
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_rim"));
@ -162,7 +162,7 @@ static void materials_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemR(layout, ptr, "material_offset", 0, NULL, ICON_NONE);
col = uiLayoutColumn(layout, true);
uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_rim"));
uiItemR(col, ptr, "material_offset_rim", 0, IFACE_("Rim"), ICON_NONE);
uiItemR(col, ptr, "material_offset_rim", 0, CTX_IFACE_(BLT_I18NCONTEXT_ID_MESH, "Rim"), ICON_NONE);
}
static void edge_data_panel_draw(const bContext *UNUSED(C), Panel *panel)
@ -181,7 +181,7 @@ static void edge_data_panel_draw(const bContext *UNUSED(C), Panel *panel)
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "edge_crease_inner", 0, IFACE_("Crease Inner"), ICON_NONE);
uiItemR(col, ptr, "edge_crease_outer", 0, IFACE_("Outer"), ICON_NONE);
uiItemR(col, ptr, "edge_crease_rim", 0, IFACE_("Rim"), ICON_NONE);
uiItemR(col, ptr, "edge_crease_rim", 0, CTX_IFACE_(BLT_I18NCONTEXT_ID_MESH, "Rim"), ICON_NONE);
}
uiItemR(layout, ptr, "bevel_convex", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
}
@ -216,7 +216,7 @@ static void vertex_group_panel_draw(const bContext *UNUSED(C), Panel *panel)
col = uiLayoutColumn(layout, false);
uiItemPointerR(
col, ptr, "shell_vertex_group", &ob_ptr, "vertex_groups", IFACE_("Shell"), ICON_NONE);
uiItemPointerR(col, ptr, "rim_vertex_group", &ob_ptr, "vertex_groups", IFACE_("Rim"), ICON_NONE);
uiItemPointerR(col, ptr, "rim_vertex_group", &ob_ptr, "vertex_groups", CTX_IFACE_(BLT_I18NCONTEXT_ID_MESH, "Rim"), ICON_NONE);
}
static void panelRegister(ARegionType *region_type)