I18n: Disambiguate "Smooth"

"Smooth" can be many things, but mostly a verb or adjective depending
on context.

Already handled in the past, but some things were missed or introduced
since then.
This commit is contained in:
Damien Picard
2025-01-05 13:10:17 +01:00
committed by Bastien Montagne
parent 4a8d494240
commit e699f0e5c7
9 changed files with 12 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
from bpy.types import Header, Menu, Panel
from bpy.app.translations import contexts as i18n_contexts
from bl_ui.space_dopesheet import (
DopesheetFilterPopoverBase,
dopesheet_filter,
@@ -334,6 +335,7 @@ class GRAPH_MT_key_density(Menu):
class GRAPH_MT_key_blending(Menu):
bl_label = "Blend"
bl_translation_context = i18n_contexts.operator_default
def draw(self, _context):
layout = self.layout
@@ -354,6 +356,7 @@ class GRAPH_MT_key_blending(Menu):
class GRAPH_MT_key_smoothing(Menu):
bl_label = "Smooth"
bl_translation_context = i18n_contexts.operator_default
def draw(self, _context):
layout = self.layout

View File

@@ -3643,7 +3643,7 @@ class VIEW3D_MT_sculpt(Menu):
layout.separator()
sculpt_filters_types = [
('SMOOTH', iface_("Smooth")),
('SMOOTH', iface_("Smooth", i18n_contexts.operator_default)),
('SURFACE_SMOOTH', iface_("Surface Smooth")),
('INFLATE', iface_("Inflate")),
('RELAX', iface_("Relax Topology")),

View File

@@ -139,6 +139,7 @@ const char *BLT_translate_do_new_dataname(const char *msgctxt, const char *msgid
#define BLT_I18NCONTEXT_AMOUNT "Amount"
#define BLT_I18NCONTEXT_COLOR "Color"
#define BLT_I18NCONTEXT_CONSTRAINT "Constraint"
#define BLT_I18NCONTEXT_MODIFIER "Modifier"
#define BLT_I18NCONTEXT_NAVIGATION "Navigation"
#define BLT_I18NCONTEXT_RENDER_LAYER "Render Layer"
#define BLT_I18NCONTEXT_TIME "Time"
@@ -213,6 +214,7 @@ struct BLT_i18n_contexts_descriptor {
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_AMOUNT, "amount"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_COLOR, "color"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_CONSTRAINT, "constraint"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_MODIFIER, "modifier"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_NAVIGATION, "navigation"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_RENDER_LAYER, "render_layer"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_TIME, "time"), \

View File

@@ -204,6 +204,7 @@ void paint_stroke_operator_properties(wmOperatorType *ot)
BRUSH_STROKE_NORMAL,
"Stroke Mode",
"Action taken when a paint stroke is made");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_OPERATOR_DEFAULT);
RNA_def_property_flag(prop, PropertyFlag(PROP_SKIP_SAVE));
/* TODO: Pen flip logic should likely be combined into the stroke mode logic instead of being

View File

@@ -6315,6 +6315,7 @@ static void rna_def_modifier_remesh(BlenderRNA *brna)
prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_MODIFIER);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);

View File

@@ -1258,6 +1258,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
RNA_def_property_enum_items(prop, rna_enum_particle_edit_hair_brush_items);
RNA_def_property_enum_funcs(
prop, nullptr, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_OPERATOR_DEFAULT);
RNA_def_property_ui_text(prop, "Tool", "");
prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);

View File

@@ -4944,6 +4944,7 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna)
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Smooth", "Smooth the lighting from this light");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_OPERATOR_DEFAULT);
RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
prop = RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);

View File

@@ -8,7 +8,7 @@ namespace blender::nodes::node_geo_input_edge_smooth_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Bool>("Smooth").field_source();
b.add_output<decl::Bool>("Smooth").field_source().translation_context(BLT_I18NCONTEXT_ID_MESH);
}
static void node_geo_exec(GeoNodeExecParams params)

View File

@@ -8,7 +8,7 @@ namespace blender::nodes::node_geo_input_face_smooth_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Bool>("Smooth").field_source();
b.add_output<decl::Bool>("Smooth").field_source().translation_context(BLT_I18NCONTEXT_ID_MESH);
}
static void node_geo_exec(GeoNodeExecParams params)