diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index eb4000b0856..086e8bf5879 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -19,6 +19,8 @@ #include "BLI_math_vector_types.hh" #include "BLI_span.hh" +#include "BLT_translation.h" + #include "FN_field.hh" #include "BLT_translation.h" @@ -49,8 +51,8 @@ std::ostream &operator<<(std::ostream &stream, const AttributeIDRef &attribute_i return stream; } -const char *no_procedural_access_message = - "This attribute can not be accessed in a procedural context"; +const char *no_procedural_access_message = N_( + "This attribute can not be accessed in a procedural context"); bool allow_procedural_attribute_access(StringRef attribute_name) { diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 560a07dee3b..f1d9200ef6f 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -847,7 +847,7 @@ static void create_inspection_string_for_generic_value(const bNodeSocket &socket return; } if (value_type.is()) { - ss << *static_cast(buffer) << TIP_(" (String)"); + ss << *static_cast(buffer) << " " << TIP_("(String)"); return; } @@ -864,22 +864,22 @@ static void create_inspection_string_for_generic_value(const bNodeSocket &socket BLI_SCOPED_DEFER([&]() { socket_type.destruct(socket_value); }); if (socket_type.is()) { - ss << *static_cast(socket_value) << TIP_(" (Integer)"); + ss << *static_cast(socket_value) << " " << TIP_("(Integer)"); } else if (socket_type.is()) { - ss << *static_cast(socket_value) << TIP_(" (Float)"); + ss << *static_cast(socket_value) << " " << TIP_("(Float)"); } else if (socket_type.is()) { - ss << *static_cast(socket_value) << TIP_(" (Vector)"); + ss << *static_cast(socket_value) << " " << TIP_("(Vector)"); } else if (socket_type.is()) { const blender::ColorGeometry4f &color = *static_cast(socket_value); - ss << "(" << color.r << ", " << color.g << ", " << color.b << ", " << color.a << ")" - << TIP_(" (Color)"); + ss << "(" << color.r << ", " << color.g << ", " << color.b << ", " << color.a << ") " + << TIP_("(Color)"); } else if (socket_type.is()) { - ss << ((*static_cast(socket_value)) ? TIP_("True") : TIP_("False")) - << TIP_(" (Boolean)"); + ss << ((*static_cast(socket_value)) ? TIP_("True") : TIP_("False")) << " " + << TIP_("(Boolean)"); } } @@ -893,32 +893,32 @@ static void create_inspection_string_for_field_info(const bNodeSocket &socket, if (input_tooltips.is_empty()) { /* Should have been logged as constant value. */ BLI_assert_unreachable(); - ss << "Value has not been logged"; + ss << TIP_("Value has not been logged"); } else { if (socket_type.is()) { - ss << TIP_("Integer field"); + ss << TIP_("Integer field based on:"); } else if (socket_type.is()) { - ss << TIP_("Float field"); + ss << TIP_("Float field based on:"); } else if (socket_type.is()) { - ss << TIP_("Vector field"); + ss << TIP_("Vector field based on:"); } else if (socket_type.is()) { - ss << TIP_("Boolean field"); + ss << TIP_("Boolean field based on:"); } else if (socket_type.is()) { - ss << TIP_("String field"); + ss << TIP_("String field based on:"); } else if (socket_type.is()) { - ss << TIP_("Color field"); + ss << TIP_("Color field based on:"); } - ss << TIP_(" based on:\n"); + ss << "\n"; for (const int i : input_tooltips.index_range()) { const blender::StringRef tooltip = input_tooltips[i]; - ss << "\u2022 " << tooltip; + ss << "\u2022 " << TIP_(tooltip.data()); if (i < input_tooltips.size() - 1) { ss << ".\n"; } @@ -941,7 +941,7 @@ static void create_inspection_string_for_geometry_info(const geo_log::GeometryIn return std::string(str); }; - ss << TIP_("Geometry:\n"); + ss << TIP_("Geometry:") << "\n"; for (GeometryComponentType type : component_types) { switch (type) { case GEO_COMPONENT_TYPE_MESH: { @@ -1865,7 +1865,7 @@ static char *named_attribute_tooltip(bContext * /*C*/, void *argN, const char * NamedAttributeTooltipArg &arg = *static_cast(argN); std::stringstream ss; - ss << TIP_("Accessed named attributes:\n"); + ss << TIP_("Accessed named attributes:") << "\n"; struct NameWithUsage { StringRefNull name; @@ -1917,7 +1917,7 @@ static NodeExtraInfoRow row_from_used_named_attribute( NodeExtraInfoRow row; row.text = std::to_string(attributes_num) + - TIP_(attributes_num == 1 ? " Named Attribute" : " Named Attributes"); + (attributes_num == 1 ? TIP_(" Named Attribute") : TIP_(" Named Attributes")); row.icon = ICON_SPREADSHEET; row.tooltip_fn = named_attribute_tooltip; row.tooltip_fn_arg = new NamedAttributeTooltipArg{usage_by_attribute_name}; diff --git a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc index 3c4bb00730f..7b39b39c78b 100644 --- a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc +++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc @@ -568,7 +568,7 @@ static void spreadsheet_footer_region_draw(const bContext *C, ARegion *region) SpaceSpreadsheet *sspreadsheet = CTX_wm_space_spreadsheet(C); SpaceSpreadsheet_Runtime *runtime = sspreadsheet->runtime; std::stringstream ss; - ss << "Rows: "; + ss << IFACE_("Rows:") << " "; if (runtime->visible_rows != runtime->tot_rows) { char visible_rows_str[BLI_STR_FORMAT_INT32_GROUPED_SIZE]; BLI_str_format_int_grouped(visible_rows_str, runtime->visible_rows); @@ -576,7 +576,7 @@ static void spreadsheet_footer_region_draw(const bContext *C, ARegion *region) } char tot_rows_str[BLI_STR_FORMAT_INT32_GROUPED_SIZE]; BLI_str_format_int_grouped(tot_rows_str, runtime->tot_rows); - ss << tot_rows_str << " | Columns: " << runtime->tot_columns; + ss << tot_rows_str << " | " << IFACE_("Columns:") << " " << runtime->tot_columns; std::string stats_str = ss.str(); UI_ThemeClearColor(TH_BACK); diff --git a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc index f7a8496868e..f7f3e1bf076 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc @@ -15,25 +15,26 @@ NODE_STORAGE_FUNCS(NodeAccumulateField) static void node_declare(NodeDeclarationBuilder &b) { - std::string value_in_description = "The values to be accumulated"; - std::string leading_out_description = - "The running total of values in the corresponding group, starting at the first value"; - std::string trailing_out_description = - "The running total of values in the corresponding group, starting at zero"; - std::string total_out_description = "The total of all of the values in the corresponding group"; + std::string value_in_description = N_("The values to be accumulated"); + std::string leading_out_description = N_( + "The running total of values in the corresponding group, starting at the first value"); + std::string trailing_out_description = N_( + "The running total of values in the corresponding group, starting at zero"); + std::string total_out_description = N_( + "The total of all of the values in the corresponding group"); b.add_input(N_("Value"), "Value Vector") .default_value({1.0f, 1.0f, 1.0f}) .supports_field() - .description(N_(value_in_description)); + .description(value_in_description); b.add_input(N_("Value"), "Value Float") .default_value(1.0f) .supports_field() - .description(N_(value_in_description)); + .description(value_in_description); b.add_input(N_("Value"), "Value Int") .default_value(1) .supports_field() - .description(N_(value_in_description)); + .description(value_in_description); b.add_input(N_("Group ID"), "Group Index") .supports_field() .description( @@ -41,33 +42,33 @@ static void node_declare(NodeDeclarationBuilder &b) b.add_output(N_("Leading"), "Leading Vector") .field_source_reference_all() - .description(N_(leading_out_description)); + .description(leading_out_description); b.add_output(N_("Leading"), "Leading Float") .field_source_reference_all() - .description(N_(leading_out_description)); + .description(leading_out_description); b.add_output(N_("Leading"), "Leading Int") .field_source_reference_all() - .description(N_(leading_out_description)); + .description(leading_out_description); b.add_output(N_("Trailing"), "Trailing Vector") .field_source_reference_all() - .description(N_(trailing_out_description)); + .description(trailing_out_description); b.add_output(N_("Trailing"), "Trailing Float") .field_source_reference_all() - .description(N_(trailing_out_description)); + .description(trailing_out_description); b.add_output(N_("Trailing"), "Trailing Int") .field_source_reference_all() - .description(N_(trailing_out_description)); + .description(trailing_out_description); b.add_output(N_("Total"), "Total Vector") .field_source_reference_all() - .description(N_(total_out_description)); + .description(total_out_description); b.add_output(N_("Total"), "Total Float") .field_source_reference_all() - .description(N_(total_out_description)); + .description(total_out_description); b.add_output(N_("Total"), "Total Int") .field_source_reference_all() - .description(N_(total_out_description)); + .description(total_out_description); } static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc index d31366f9c93..d7b4275040b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc @@ -3,6 +3,8 @@ #include "UI_interface.h" #include "UI_resources.h" +#include "BLT_translation.h" + #include "node_geometry_util.hh" namespace blender::nodes::node_geo_attribute_domain_size_cc { @@ -10,22 +12,22 @@ namespace blender::nodes::node_geo_attribute_domain_size_cc { static void node_declare(NodeDeclarationBuilder &b) { b.add_input("Geometry"); - b.add_output("Point Count").make_available([](bNode &node) { + b.add_output(N_("Point Count")).make_available([](bNode &node) { node.custom1 = GEO_COMPONENT_TYPE_MESH; }); - b.add_output("Edge Count").make_available([](bNode &node) { + b.add_output(N_("Edge Count")).make_available([](bNode &node) { node.custom1 = GEO_COMPONENT_TYPE_MESH; }); - b.add_output("Face Count").make_available([](bNode &node) { + b.add_output(N_("Face Count")).make_available([](bNode &node) { node.custom1 = GEO_COMPONENT_TYPE_MESH; }); - b.add_output("Face Corner Count").make_available([](bNode &node) { + b.add_output(N_("Face Corner Count")).make_available([](bNode &node) { node.custom1 = GEO_COMPONENT_TYPE_MESH; }); - b.add_output("Spline Count").make_available([](bNode &node) { + b.add_output(N_("Spline Count")).make_available([](bNode &node) { node.custom1 = GEO_COMPONENT_TYPE_CURVE; }); - b.add_output("Instance Count").make_available([](bNode &node) { + b.add_output(N_("Instance Count")).make_available([](bNode &node) { node.custom1 = GEO_COMPONENT_TYPE_INSTANCES; }); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_collection_info.cc b/source/blender/nodes/geometry/nodes/node_geo_collection_info.cc index 8f946fb0403..5d6ca673daa 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_collection_info.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_collection_info.cc @@ -61,7 +61,7 @@ static void node_geo_exec(GeoNodeExecParams params) const bool is_recursive = BKE_collection_has_object_recursive_instanced( collection, const_cast(self_object)); if (is_recursive) { - params.error_message_add(NodeWarningType::Error, "Collection contains current object"); + params.error_message_add(NodeWarningType::Error, TIP_("Collection contains current object")); params.set_default_remaining_outputs(); return; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc index b9d0b8b5d28..b08ce192a81 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc @@ -59,12 +59,15 @@ static void node_geo_exec(GeoNodeExecParams params) } if (!attribute_exists) { - params.error_message_add(NodeWarningType::Info, - TIP_("Attribute does not exist: \"") + name + "\""); + char *message = BLI_sprintfN(TIP_("Attribute does not exist: \"%s\""), name.c_str()); + params.error_message_add(NodeWarningType::Warning, message); + MEM_freeN(message); } if (cannot_delete) { - params.error_message_add(NodeWarningType::Warning, - TIP_("Cannot delete built-in attribute with name \"") + name + "\""); + char *message = BLI_sprintfN(TIP_("Cannot delete built-in attribute with name \"%s\""), + name.c_str()); + params.error_message_add(NodeWarningType::Warning, message); + MEM_freeN(message); } params.set_output("Geometry", std::move(geometry_set));