From 935283e78cbb5ef0130d178f60413d316bb9befa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Capello?= Date: Tue, 29 Apr 2025 17:20:32 -0300 Subject: [PATCH] Internationalize " Copy" string usage --- data/strings/en.ini | 1 + src/app/commands/cmd_duplicate_slice.cpp | 2 +- src/app/util/clipboard.cpp | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/strings/en.ini b/data/strings/en.ini index b86856a81..7191db61f 100644 --- a/data/strings/en.ini +++ b/data/strings/en.ini @@ -828,6 +828,7 @@ same_in_all_tools = Same in all Tools opacity = Opacity: tolerance = Tolerance: show_more = Show more... +copy_of = {} Copy [general_text] copy = &Copy diff --git a/src/app/commands/cmd_duplicate_slice.cpp b/src/app/commands/cmd_duplicate_slice.cpp index 810061606..881effc79 100644 --- a/src/app/commands/cmd_duplicate_slice.cpp +++ b/src/app/commands/cmd_duplicate_slice.cpp @@ -90,7 +90,7 @@ void DuplicateSliceCommand::onExecute(Context* context) doc->notifyBeforeSlicesDuplication(); for (auto* s : selectedSlices) { Slice* slice = new Slice(*s); - slice->setName(slice->name() + " Copy"); + slice->setName(Strings::general_copy_of(slice->name())); // Offset a bit the duplicated slice to avoid overlapping offset(slice, 2, 2); diff --git a/src/app/util/clipboard.cpp b/src/app/util/clipboard.cpp index 58f70bdcf..8a63fac55 100644 --- a/src/app/util/clipboard.cpp +++ b/src/app/util/clipboard.cpp @@ -21,6 +21,7 @@ #include "app/doc_api.h" #include "app/doc_range.h" #include "app/doc_range_ops.h" +#include "app/i18n/strings.h" #include "app/modules/gfx.h" #include "app/modules/gui.h" #include "app/pref/preferences.h" @@ -827,7 +828,7 @@ void Clipboard::paste(Context* ctx, const bool interactive, const gfx::Point* po editor->clearSlicesSelection(); for (auto& s : slices) { Slice* slice = new Slice(s); - slice->setName(slice->name() + " Copy"); + slice->setName(Strings::general_copy_of(slice->name())); tx(new cmd::AddSlice(dstSpr, slice)); editor->selectSlice(slice); }