1 /* 2 * Copyright 2006, 2023, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 * Zardshard 8 */ 9 10 #include "AddPathsCommand.h" 11 12 #include <Catalog.h> 13 #include <Locale.h> 14 #include <StringFormat.h> 15 16 #include "VectorPath.h" 17 18 19 #undef B_TRANSLATION_CONTEXT 20 #define B_TRANSLATION_CONTEXT "Icon-O-Matic-AddPathsCmd" 21 22 23 AddPathsCommand::AddPathsCommand(Container<VectorPath>* container, 24 const VectorPath* const* paths, int32 count, bool ownsPaths, int32 index) 25 : AddCommand<VectorPath>(container, paths, count, ownsPaths, index) 26 { 27 } 28 29 30 AddPathsCommand::~AddPathsCommand() 31 { 32 } 33 34 35 void 36 AddPathsCommand::GetName(BString& name) 37 { 38 static BStringFormat addFormat(B_TRANSLATE("Add {0, plural, " 39 "one{path} other{paths}}")); 40 static BStringFormat assignFormat(B_TRANSLATE("Assign {0, plural, " 41 "one{path} other{paths}}")); 42 if (fOwnsItems) 43 addFormat.Format(name, fCount); 44 else 45 assignFormat.Format(name, fCount); 46 } 47