diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc index 6afbea919c5..bf4d9d4dc7c 100644 --- a/source/blender/editors/asset/intern/asset_ops.cc +++ b/source/blender/editors/asset/intern/asset_ops.cc @@ -462,7 +462,7 @@ static int asset_catalog_new_exec(bContext *C, wmOperator *op) char *parent_path = RNA_string_get_alloc(op->ptr, "parent_path", nullptr, 0, nullptr); blender::asset_system::AssetCatalog *new_catalog = ED_asset_catalog_add( - asset_library, "Catalog", parent_path); + asset_library, DATA_("Catalog"), parent_path); if (sfile) { ED_fileselect_activate_asset_catalog(sfile, new_catalog->catalog_id); diff --git a/source/blender/editors/space_file/CMakeLists.txt b/source/blender/editors/space_file/CMakeLists.txt index 76768d16d01..575fa15eeb1 100644 --- a/source/blender/editors/space_file/CMakeLists.txt +++ b/source/blender/editors/space_file/CMakeLists.txt @@ -17,6 +17,7 @@ set(INC ../../windowmanager ../../../../intern/atomic ../../../../intern/guardedalloc + ../../../../extern/fmtlib/include # dna_type_offsets.h ${CMAKE_CURRENT_BINARY_DIR}/../../makesdna/intern diff --git a/source/blender/editors/space_file/asset_catalog_tree_view.cc b/source/blender/editors/space_file/asset_catalog_tree_view.cc index 94189841747..a698e1159cf 100644 --- a/source/blender/editors/space_file/asset_catalog_tree_view.cc +++ b/source/blender/editors/space_file/asset_catalog_tree_view.cc @@ -34,6 +34,9 @@ #include "file_intern.h" #include "filelist.h" +#define FMT_HEADER_ONLY +#include + using namespace blender; using namespace blender::asset_system; @@ -373,11 +376,11 @@ bool AssetCatalogDropTarget::can_drop(const wmDrag &drag, const char **r_disable * path and the catalog system will generate missing parents from the path). But it does * appear broken to users, so disabling entirely. */ if (catalog_item_.catalog_path().is_contained_in(drag_catalog->path)) { - *r_disabled_hint = "Catalog cannot be dropped into itself"; + *r_disabled_hint = TIP_("Catalog cannot be dropped into itself"); return false; } if (catalog_item_.catalog_path() == drag_catalog->path.parent()) { - *r_disabled_hint = "Catalog is already placed inside this catalog"; + *r_disabled_hint = TIP_("Catalog is already placed inside this catalog"); return false; } return true; @@ -401,8 +404,8 @@ std::string AssetCatalogDropTarget::drop_tooltip_asset_catalog(const wmDrag &dra BLI_assert(drag.type == WM_DRAG_ASSET_CATALOG); const AssetCatalog *src_catalog = get_drag_catalog(drag, get_asset_library()); - return std::string(TIP_("Move Catalog")) + " '" + src_catalog->path.name() + "' " + - TIP_("into") + " '" + catalog_item_.get_name() + "'"; + return fmt::format( + TIP_("Move catalog {} into {}"), src_catalog->path.name(), catalog_item_.get_name()); } std::string AssetCatalogDropTarget::drop_tooltip_asset_list(const wmDrag &drag) const @@ -523,7 +526,7 @@ bool AssetCatalogDropTarget::can_modify_catalogs(const ::AssetLibrary &library, const char **r_disabled_hint) { if (ED_asset_catalogs_read_only(library)) { - *r_disabled_hint = "Catalogs cannot be edited in this asset library"; + *r_disabled_hint = TIP_("Catalogs cannot be edited in this asset library"); return false; } return true; @@ -602,7 +605,7 @@ bool AssetCatalogTreeViewAllItem::DropTarget::can_drop(const wmDrag &drag, const AssetCatalog *drag_catalog = AssetCatalogDropTarget::get_drag_catalog(drag, library); if (drag_catalog->path.parent() == "") { - *r_disabled_hint = "Catalog is already placed at the highest level"; + *r_disabled_hint = TIP_("Catalog is already placed at the highest level"); return false; } @@ -615,8 +618,8 @@ std::string AssetCatalogTreeViewAllItem::DropTarget::drop_tooltip(const wmDrag & const AssetCatalog *drag_catalog = AssetCatalogDropTarget::get_drag_catalog( drag, *get_view().asset_library_); - return std::string(TIP_("Move Catalog")) + " '" + drag_catalog->path.name() + "' " + - TIP_("to the top level of the tree"); + return fmt::format(TIP_("Move catalog {} to the top level of the tree"), + drag_catalog->path.name()); } bool AssetCatalogTreeViewAllItem::DropTarget::on_drop(struct bContext * /*C*/,