Salome HOME
Replace error construction with + with using %1 placeholders
authorspo <sergey.pokhodenko@opencascade.com>
Fri, 24 Jun 2016 12:23:47 +0000 (15:23 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 24 Jun 2016 16:06:06 +0000 (19:06 +0300)
12 files changed:
src/BuildPlugin/BuildPlugin_Validators.cpp
src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp
src/FeaturesPlugin/FeaturesPlugin_Validators.cpp
src/GeomValidators/GeomValidators_BodyShapes.cpp
src/GeomValidators/GeomValidators_ConstructionComposite.cpp
src/GeomValidators/GeomValidators_Face.cpp
src/GeomValidators/GeomValidators_MinObjectsSelected.cpp
src/GeomValidators/GeomValidators_ShapeType.cpp
src/Model/Model_FeatureValidator.cpp
src/ParametersPlugin/ParametersPlugin_Validators.cpp
src/PartSet/PartSet_Validators.cpp
src/SketchPlugin/SketchPlugin_Validators.cpp

index 9c2be0baebd25d48fe5a6cdff4da114cf3ec120a..b75c77e54577815bc538f8c895dc3b0dd0abdb90 100644 (file)
@@ -119,7 +119,8 @@ bool BuildPlugin_ValidatorBaseForWire::isValid(const std::shared_ptr<ModelAPI_Fe
   }
   AttributeSelectionListPtr aSelectionList = theFeature->selectionList(theArguments.front());
   if(!aSelectionList.get()) {
-    theError = "Empty attribute \"" + theArguments.front() + "\".";
+    theError = "Empty attribute \"%1\".";
+    theError.arg(theArguments.front());
     return false;
   }
 
@@ -165,7 +166,8 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptr<ModelAPI_Fe
   }
   AttributeSelectionListPtr aSelectionList = theFeature->selectionList(theArguments.front());
   if(!aSelectionList.get()) {
-    theError = "Empty attribute \"" + theArguments.front() + "\".";
+    theError = "Empty attribute \"%1\".";
+    theError.arg(theArguments.front());
     return false;
   }
 
index 9722f88361b267612baf4f5264c75aebe2b00975..4057abd68a538547b6a1002b2972779657cbcc57 100755 (executable)
@@ -17,7 +17,8 @@ bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute
   bool aValid = true;
   std::string anAttributeType = theAttribute->attributeType();
   if (anAttributeType != ModelAPI_AttributeSelectionList::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -47,10 +48,8 @@ bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute
   if (!aValid) {
     std::string aResultGroupName = isPartSetDocument ? ModelAPI_ResultPart::group()
                                                      : ModelAPI_ResultBody::group();
-    theError = "Objects from the " + aResultGroupName  +
-                " group can be selected in the " + aDocument->kind() +
-                "document, but an objects from the " + anErrorGroupName +
-                " group is selected.";
+    theError = "Objects from the %1 group can be selected in the %2 document, but an objects from the %3 group is selected.";
+    theError.arg(aResultGroupName).arg(aDocument->kind()).arg(anErrorGroupName);
   }
   return aValid;
 }
index ff7d8cb391a1963bea496a14eba4ca6c7134ce00..c77f516b64c14c8b09fe732d2efa850e360139ec 100644 (file)
@@ -73,13 +73,15 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptr<ModelA
   static const std::string aLocationsID = "locations_objects";
 
   if(theFeature->getKind() != "Pipe") {
-    theError = "Error: Feature \"" + theFeature->getKind() + "\" does not supported by this validator.";
+    theError = "Error: Feature \"%1\" does not supported by this validator.";
+    theError.arg(theFeature->getKind());
     return false;
   }
 
   AttributeStringPtr aCreationMethodAttr = theFeature->string(aCreationMethodID);
   if(!aCreationMethodAttr.get()) {
-    theError = "Error: Could not get \"" + aCreationMethodID + "\" attribute.";
+    theError = "Error: Could not get \"%1\" attribute.";
+    theError.arg(aCreationMethodID);
     return false;
   }
 
@@ -89,13 +91,15 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptr<ModelA
 
   AttributeSelectionListPtr aBaseObjectsSelectionList = theFeature->selectionList(aBaseObjectsID);
   if(!aBaseObjectsSelectionList.get()) {
-    theError = "Error: Could not get \"" + aBaseObjectsID + "\" attribute.";
+    theError = "Error: Could not get \"%1\" attribute.";
+    theError.arg(aBaseObjectsID);
     return false;
   }
 
   AttributeSelectionListPtr aLocationsSelectionList = theFeature->selectionList(aLocationsID);
   if(!aLocationsSelectionList.get()) {
-    theError = "Error: Could not get \"" + aBaseObjectsID + "\" attribute.";
+    theError = "Error: Could not get \"%1\" attribute.";
+    theError.arg(aBaseObjectsID);
     return false;
   }
 
@@ -276,8 +280,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
     // Check that object is a shape with allowed type.
     GeomValidators_ShapeType aShapeTypeValidator;
     if(!aShapeTypeValidator.isValid(anAttr, theArguments, theError)) {
-      theError = "Error: Selected shape has unacceptable type. Acceptable types are: faces or wires on sketch, "
-                 "whole sketch(if it has at least one face), and whole objects with shape types: %1";
+      theError = "Error: Selected shape has unacceptable type. Acceptable types are: faces or wires on sketch, whole sketch(if it has at least one face), and whole objects with shape types: %1";
       std::string anArgumentString;
       for(auto anIt = theArguments.cbegin(); anIt != theArguments.cend(); ++anIt) {
         if (!anArgumentString.empty())
@@ -289,7 +292,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
     }
 
   } else {
-    theError = "Error: Attribute \"" + anAttributeType + "\" does not supported by this validator.";
+    theError = "Error: Attribute \"%1\" does not supported by this validator.";
+    theError.arg(anAttributeType);
     return false;
   }
 
@@ -302,11 +306,13 @@ bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theA
                                                         Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeReference::typeId()) {
-    theError = "Error: The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "Error: The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
   if (theArguments.size() != 2) {
-    theError = "Error: Wrong parameters in XML definition for " + theAttribute->attributeType() + " type";
+    theError = "Error: Wrong parameters in XML definition for %1 type";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
   // first argument is for the base attribute, second - for skipping feature kind
@@ -315,7 +321,8 @@ bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theA
   FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
   AttributePtr aBaseAttribute = aFeature->attribute(aBaseAttributeId);
   if (!aBaseAttribute.get()) {
-    theError = "Wrong parameters in XML definition for " + theAttribute->attributeType() + " type";
+    theError = "Wrong parameters in XML definition for %1 type";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
   if (aBaseAttribute->isInitialized()) // when base list of composite feature is already filled,
@@ -371,8 +378,8 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptr<ModelAP
   if(!aDirShape.get()) {
     // Check that dir can be empty.
     if(!isShapesCanBeEmpty(aCheckAttribute, theError)) {
-      theError = "Error: Base objects list contains vertex or edge, so attribute \"" + *anArgsIt
-               + "\" can not be used with default value. Select direction for extrusion.";
+      theError = "Error: Base objects list contains vertex or edge, so attribute \"%1\" can not be used with default value. Select direction for extrusion.";
+      theError.arg(*anArgsIt);
       return false;
     } else {
       return true;
@@ -603,7 +610,8 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt
   AttributeSelectionPtr aShapeAttrSelection = aFeature->selection(aBaseShapeID);
 
   if(!aShapeAttrSelection.get()) {
-    theError = "Error: Could not get \"" + aBaseShapeID + "\" attribute.";
+    theError = "Error: Could not get \"%1\" attribute.";
+    theError.arg(aBaseShapeID);
     return false;
   }
 
@@ -649,19 +657,22 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(const std::shared_pt
   static const std::string aSubShapesID = "subshapes";
 
   if(theFeature->getKind() != "Remove_SubShapes") {
-    theError = "Error: Feature \"" + theFeature->getKind() + "\" does not supported by this validator.";
+    theError = "Error: Feature \"%1\" does not supported by this validator.";
+    theError.arg(theFeature->getKind());
     return false;
   }
 
   AttributeSelectionPtr aShapeAttrSelection = theFeature->selection(aBaseShapeID);
   if(!aShapeAttrSelection.get()) {
-    theError = "Error: Could not get \"" + aBaseShapeID + "\" attribute.";
+    theError = "Error: Could not get \"%1\" attribute.";
+    theError.arg(aBaseShapeID);
     return false;
   }
 
   AttributeSelectionListPtr aSubShapesAttrList = theFeature->selectionList(aSubShapesID);
   if(!aSubShapesAttrList.get()) {
-    theError = "Error: Could not get \"" + aSubShapesID + "\" attribute.";
+    theError = "Error: Could not get \"%1\" attribute.";
+    theError.arg(aSubShapesID);
     return false;
   }
 
@@ -703,7 +714,8 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr
 {
   AttributeSelectionListPtr aBaseObjectsAttrList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!aBaseObjectsAttrList.get()) {
-    theError = "Error: This validator can only work with selection list in \"" + FeaturesPlugin_Union::ID() + "\" feature.";
+    theError = "Error: This validator can only work with selection list in \"%1\" feature.";
+    theError.arg(FeaturesPlugin_Union::ID());
     return false;
   }
 
@@ -730,14 +742,16 @@ bool FeaturesPlugin_ValidatorUnionArguments::isValid(const std::shared_ptr<Model
 {
   // Check feature kind.
   if(theFeature->getKind() != FeaturesPlugin_Union::ID()) {
-    theError = "Error: This validator supports only \"" + FeaturesPlugin_Union::ID() + "\" feature.";
+    theError = "Error: This validator supports only \"%1\" feature.";
+    theError.arg(FeaturesPlugin_Union::ID());
     return false;
   }
 
   // Get base objects attribute list.
   AttributeSelectionListPtr aBaseObejctsAttrList = theFeature->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
   if(!aBaseObejctsAttrList.get()) {
-    theError = "Error: Could not get \"" + FeaturesPlugin_Union::BASE_OBJECTS_ID() + "\" attribute.";
+    theError = "Error: Could not get \"%1\" attribute.";
+    theError.arg(FeaturesPlugin_Union::BASE_OBJECTS_ID());
     return false;
   }
 
index a681fbe5d19f7983ec4aaca653ab040fca7e29e8..504daa4afda22792eb6f04cd8881092d173e6621 100644 (file)
@@ -43,7 +43,8 @@ bool GeomValidators_BodyShapes::isValid(const AttributePtr& theAttribute,
       }
     }
   } else {
-    theError = "Error: Attribute \"" + anAttributeType + "\" does not supported by this validator.";
+    theError = "Error: Attribute \"%1\" does not supported by this validator.";
+    theError.arg(anAttributeType);
     return false;
   }
 
index c748c2cdc18ea11a82e14a9d497619c998facadb..8ae2b2dbf769cc9af7a7b132bd8f2f11feb752e9 100644 (file)
@@ -15,7 +15,8 @@ bool GeomValidators_ConstructionComposite::isValid(const AttributePtr& theAttrib
   bool aValid = true;
   if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
     aValid = false;
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return aValid;
   }
 
index 391ae4f827232caa1f05d6dd197d5d13112aaa7a..dd415526378ab07ea1531b9d0558641f260fb1b2 100644 (file)
@@ -38,7 +38,8 @@ bool GeomValidators_Face::isValid(const AttributePtr& theAttribute,
 {
   std::string anAttributeType = theAttribute->attributeType();
   if (anAttributeType != ModelAPI_AttributeSelection::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
index aa4088daa7420b72710b4fad193b75c60c126402..29167f8d06c59517ae2e5406a2a515a890fc1b57 100644 (file)
@@ -24,7 +24,8 @@ bool GeomValidators_MinObjectsSelected::isValid(const std::shared_ptr<ModelAPI_F
   std::string aSelectionListId = theArguments.front();
   AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(aSelectionListId);
   if(!anAttrSelList.get()) {
-    theError = "Error: Could not get attribute \"" + aSelectionListId + "\".";
+    theError = "Error: Could not get attribute \"%1\".";
+    theError.arg(aSelectionListId);
     return false;
   }
   int anObjectsNb = anAttrSelList->size();
@@ -32,8 +33,8 @@ bool GeomValidators_MinObjectsSelected::isValid(const std::shared_ptr<ModelAPI_F
   int aMinObjectsNb = atoi(theArguments.back().c_str());
 
   if(anObjectsNb < aMinObjectsNb) {
-    theError = "Error: Attribute \"" + aSelectionListId + "\" should contain at least "
-      + theArguments.back() + " items.";
+    theError = "Error: Attribute \"%1\" should contain at least %2 items.";
+    theError.arg(aSelectionListId).arg(theArguments.back());
     return false;
   }
 
index 2027c50ea860424fb6bb730be20492c9dda18b5b..4991b92255b5a93d81c8b9ad393c1a656381eed3 100755 (executable)
@@ -90,8 +90,8 @@ bool GeomValidators_ShapeType::isValid(const AttributePtr& theAttribute,
       if (!aTypes.empty())
         aTypes += ", ";
     }
-    theError = "It does not contain element with acceptable shape type. The type should be one of the next: "
-               + aTypes;
+    theError = "It does not contain element with acceptable shape type. The type should be one of the next: %1";
+    theError.arg(aTypes);
   }
 
   return aValid;
@@ -126,9 +126,10 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute
       else {
         std::string anAttributeType = aRefAttr->attributeType();
         aValid = anAttributeType == GeomDataAPI_Point2D::typeId();
-        if (!aValid)
-          theError = "Shape type is \"" + anAttributeType +
-                     "\", it should be \"" + getShapeTypeDescription(theShapeType) + "\"";
+        if (!aValid) {
+          theError = "Shape type is \"%1\", it should be \"%2\"";
+          theError.arg(anAttributeType).arg(getShapeTypeDescription(theShapeType));
+        }
       }
     }
   }
@@ -153,7 +154,8 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute
   }
   else {
     aValid = false;
-    theError = "The attribute with the " + anAttributeType  + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(anAttributeType);
   }
   return aValid;
 }
index 06923d32449fc6579c0b66fbae1df529abef5cee..479405e4a3b21c56e95a1bef7ff87d29e63430d3 100644 (file)
@@ -44,7 +44,8 @@ bool Model_FeatureValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& th
         myNotObligatory.find(theFeature->getKind());
       if (aFeatureFind == myNotObligatory.end() || // and it is obligatory for filling
           aFeatureFind->second.find(*it) == aFeatureFind->second.end()) {
-        theError = "Attribute \"" + anAttr->id() + "\" is not initialized.";
+        theError = "Attribute \"%1\" is not initialized.";
+        theError.arg(anAttr->id());
         return false;
       }
     }
index ec550aecaad95bd2be334bddbff623d9fc6eed91..d0549db529e82fb0216d4d12574843e9b0faff0f 100644 (file)
@@ -30,12 +30,14 @@ bool ParametersPlugin_VariableValidator::isValid(const AttributePtr& theAttribut
 {
   AttributeStringPtr aStrAttr = std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
   if (!aStrAttr->isInitialized()) {
-    theError = "Attribute \"" + aStrAttr->id() + "\" is not initialized.";
+    theError = "Attribute \"%1\" is not initialized.";
+    theError.arg(aStrAttr->id());
     return false;
   }
   bool isEmptyExpr = aStrAttr->value().empty();
   if (isEmptyExpr) {
-    theError = "Attribute \"" + aStrAttr->id() + "\" value is empty.";
+    theError = "Attribute \"%1\" value is empty.";
+    theError.arg(aStrAttr->id());
     return false;
   }
   if (!isVariable(aStrAttr->value())) {
@@ -106,7 +108,8 @@ bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttrib
   AttributeStringPtr aStrAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
   if (!aStrAttr->isInitialized()) {
-    theError = "Attribute \"" + aStrAttr->id() + "\" is not initialized.";
+    theError = "Attribute \"%1\" is not initialized.";
+    theError.arg(aStrAttr->id());
     return false;
   }
   bool isEmptyExpr = aStrAttr->value().empty();
index 26ae2e27737535f9b5175c36cc5c0f2b90999db9..6922bb6b484bd819f93e13dba14a236261e284c5 100755 (executable)
@@ -529,7 +529,8 @@ bool PartSet_CoincidentAttr::isValid(const AttributePtr& theAttribute,
                                      Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
index 93152b1cb18ce8fe8493b39e53a95f480cbaef92..9b3d82c828a5a0ef05aaaa6fb5d64d32c3dfc4d2 100755 (executable)
@@ -50,7 +50,8 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribut
                                                  Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -151,7 +152,8 @@ bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute
                                                 Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -182,29 +184,33 @@ bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute
     if (aRefFea->getKind() == SketchPlugin_Line::ID()) {
       if (aOtherFea->getKind() != SketchPlugin_Arc::ID() &&
           aOtherFea->getKind() != SketchPlugin_Circle::ID()) {
-        theError = "It refers to a " + SketchPlugin_Line::ID() + ", but " + aParamA + " is neither an "
-          + SketchPlugin_Arc::ID() + " nor " + SketchPlugin_Circle::ID();
+        theError = "It refers to a %1, but %2 is neither an %3 nor %4";
+        theError.arg(SketchPlugin_Line::ID()).arg(aParamA)
+            .arg(SketchPlugin_Arc::ID()).arg(SketchPlugin_Circle::ID());
         return false;
       }
     }
     else if (aRefFea->getKind() == SketchPlugin_Arc::ID()) {
       if (aOtherFea->getKind() != SketchPlugin_Line::ID() &&
         aOtherFea->getKind() != SketchPlugin_Arc::ID()) {
-        theError = "It refers to an " + SketchPlugin_Arc::ID() + ", but " + aParamA + " is not a "
-          + SketchPlugin_Line::ID() + " or an " + SketchPlugin_Arc::ID();
+        theError = "It refers to an %1, but %2 is not a %3 or an %4";
+        theError.arg(SketchPlugin_Arc::ID()).arg(aParamA)
+            .arg(SketchPlugin_Line::ID()).arg(SketchPlugin_Arc::ID());
         return false;
       }
     }
     else if (aRefFea->getKind() == SketchPlugin_Circle::ID()) {
       if (aOtherFea->getKind() != SketchPlugin_Line::ID()) {
-        theError = "It refers to an " + SketchPlugin_Circle::ID() + ", but " + aParamA + " is not a "
-          + SketchPlugin_Line::ID();
+        theError = "It refers to an %1, but %2 is not a %3";
+        theError.arg(SketchPlugin_Circle::ID()).arg(aParamA)
+            .arg(SketchPlugin_Line::ID());
         return false;
       }
     }
     else {
-      theError = "It refers to " + aRefFea->getKind() + ", but should refer to " + SketchPlugin_Line::ID()
-        + " or " + SketchPlugin_Arc::ID() + " or " + SketchPlugin_Circle::ID();
+      theError = "It refers to %1, but should refer to %2 or %3 or %4";
+      theError.arg(aRefFea->getKind()).arg(SketchPlugin_Line::ID())
+          .arg(SketchPlugin_Arc::ID()).arg(SketchPlugin_Circle::ID());
       return false;
     }
     return true;
@@ -222,7 +228,8 @@ bool SketchPlugin_NotFixedValidator::isValid(const AttributePtr& theAttribute,
                                              Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -245,14 +252,16 @@ bool SketchPlugin_NotFixedValidator::isValid(const AttributePtr& theAttribute,
       if (aRefAttr->object() == aRAttr->object()) {
         ObjectPtr anObject = aRefAttr->object();
         std::string aName = anObject.get() ? anObject->data()->name() : "";
-        theError = "The object " + aName + " has been already fixed.";
+        theError = "The object %1 has been already fixed.";
+        theError.arg(aName);
         return false;
       }
     }
     else if (aRefAttr->attr() == aRAttr->attr()) {
       AttributePtr anAttribute = aRefAttr->attr();
       std::string aName = anAttribute.get() ? anAttribute->id() : "";
-      theError = "The attribute " + aName + " has been already fixed.";
+      theError = "The attribute %1 has been already fixed.";
+      theError.arg(aName);
       return false;
     }
   }
@@ -264,7 +273,8 @@ bool SketchPlugin_EqualAttrValidator::isValid(const AttributePtr& theAttribute,
                                               Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -298,9 +308,9 @@ bool SketchPlugin_EqualAttrValidator::isValid(const AttributePtr& theAttribute,
     if (aFeature->getKind() != SketchPlugin_Line::ID() &&
         aFeature->getKind() != SketchPlugin_Circle::ID() &&
         aFeature->getKind() != SketchPlugin_Arc::ID()) {
-      theError = "The " + aFeature->getKind() + " feature kind of attribute is wrong. It should be " +
-                 SketchPlugin_Line::ID() + " or " + SketchPlugin_Circle::ID() + " or " + 
-                 SketchPlugin_Arc::ID();
+      theError = "The %1 feature kind of attribute is wrong. It should be %2 or %3 or %4";
+      theError.arg(aFeature->getKind()).arg(SketchPlugin_Line::ID())
+          .arg(SketchPlugin_Circle::ID()).arg(SketchPlugin_Arc::ID());
       // wrong type of attribute
       return false;
     }
@@ -308,7 +318,8 @@ bool SketchPlugin_EqualAttrValidator::isValid(const AttributePtr& theAttribute,
 
   if ((aType[0] == SketchPlugin_Line::ID() || aType[1] == SketchPlugin_Line::ID()) &&
       aType[0] != aType[1]) {
-    theError = "Feature with kinds " + aType[0] + " and " + aType[1] + "can not be equal.";
+    theError = "Feature with kinds %1 and %2 can not be equal.";
+    theError.arg(aType[0]).arg(aType[1]);
     return false;
   }
   return true;
@@ -319,7 +330,8 @@ bool SketchPlugin_MirrorAttrValidator::isValid(const AttributePtr& theAttribute,
                                                Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefList::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -336,7 +348,8 @@ bool SketchPlugin_MirrorAttrValidator::isValid(const AttributePtr& theAttribute,
     std::list<ObjectPtr>::iterator aMirIter = aMirroredObjects.begin();
     for (; aMirIter != aMirroredObjects.end(); aMirIter++)
       if (aSelObject == *aMirIter) {
-        theError = "The object " + aName + " is a result of mirror";
+        theError = "The object %1 is a result of mirror";
+        theError.arg(aName);
         return false;
       }
   }
@@ -348,7 +361,8 @@ bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttri
                                                     Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -360,7 +374,8 @@ bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttri
   FeaturePtr aConstraint = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
   AttributeRefAttrPtr aRefAttrA = aConstraint->data()->refattr(aParamA);
   if (!aRefAttrA) {
-    theError = "The " + aParamA + " attribute " + " should be " + ModelAPI_AttributeRefAttr::typeId();
+    theError = "The %1 attribute should be %2";
+    theError.arg(aParamA).arg(ModelAPI_AttributeRefAttr::typeId());
     return false;
   }
 
@@ -372,12 +387,14 @@ bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttri
   else {
     ObjectPtr anObject = aRefAttrA->object();
     if (!anObject.get()) {
-      theError = aParamA + " attribute has an empty object";
+      theError = "%1 attribute has an empty object";
+      theError.arg(aParamA);
       return false;
     }
     FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttrA->object());
     if (!aFeature.get()) {
-      theError = aParamA + " attribute has an empty feature";
+      theError = "%1 attribute has an empty feature";
+      theError.arg(aParamA);
       return false;
     }
 
@@ -391,7 +408,8 @@ bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttri
   else {
     FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttrB->object());
     if (!aFeature) {
-      theError = theAttribute->id() + " attribute has an empty object";
+      theError = "%1 attribute has an empty object";
+      theError.arg(theAttribute->id());
       return false;
     }
     if (aFeature->getKind() == SketchPlugin_Point::ID())
@@ -407,7 +425,8 @@ bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute,
                                          Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefList::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -435,7 +454,8 @@ bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute,
     for (; anObjIter != aCopiedObjects.end(); anObjIter++)
       if (aSelObject == *anObjIter) {
         std::string aName = aSelObject.get() ? aSelObject->data()->name() : "";
-        theError = "The object " + aName + " is a result of copy";
+        theError = "The object %1 is a result of copy";
+        theError.arg(aName);
         return false;
       }
   }
@@ -678,7 +698,8 @@ bool SketchPlugin_MiddlePointAttrValidator::isValid(const AttributePtr& theAttri
                                                     Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -724,13 +745,15 @@ bool SketchPlugin_ArcTangentPointValidator::isValid(const AttributePtr& theAttri
                                                     Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
   AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
   AttributePtr anAttr = aRefAttr->attr();
   if (!anAttr) {
-    theError = "The attribute " + theAttribute->id() + " should be a point";
+    theError = "The attribute %1 should be a point";
+    theError.arg(theAttribute->id());
     return false;
   }
 
@@ -740,7 +763,8 @@ bool SketchPlugin_ArcTangentPointValidator::isValid(const AttributePtr& theAttri
     // selected point should not be a center of arc
     const std::string& aPntId = anAttr->id();
     if (aPntId != SketchPlugin_Arc::START_ID() && aPntId != SketchPlugin_Arc::END_ID()) {
-      theError = "The attribute " + aPntId + " is not supported";
+      theError = "The attribute %1 is not supported";
+      theError.arg(aPntId);
       return false;
     }
   }
@@ -748,12 +772,14 @@ bool SketchPlugin_ArcTangentPointValidator::isValid(const AttributePtr& theAttri
     // selected point should be bound point of line
     const std::string& aPntId = anAttr->id();
     if (aPntId != SketchPlugin_Line::START_ID() && aPntId != SketchPlugin_Line::END_ID()) {
-      theError = "The attribute " + aPntId + " is not supported";
+      theError = "The attribute %1 is not supported";
+      theError.arg(aPntId);
       return false;
     }
   }
   else {
-    theError = "Unable to build tangent arc on " + anAttrFeature->getKind();
+    theError = "Unable to build tangent arc on %1";
+    theError.arg(anAttrFeature->getKind());
     return false;
   }
 
@@ -778,7 +804,8 @@ bool SketchPlugin_IntersectionValidator::isValid(const AttributePtr& theAttribut
                                                  Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
   AttributeSelectionPtr aLineAttr =
@@ -791,7 +818,8 @@ bool SketchPlugin_IntersectionValidator::isValid(const AttributePtr& theAttribut
   }
 
   if (!anEdge || !anEdge->isLine()) {
-    theError = "The attribute " + theAttribute->id() + " should be a line";
+    theError = "The attribute %1 should be a line";
+    theError.arg(theAttribute->id());
     return false;
   }
 
@@ -824,7 +852,8 @@ bool SketchPlugin_ProjectionValidator::isValid(const AttributePtr& theAttribute,
                                                Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
-    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    theError = "The attribute with the %1 type is not processed";
+    theError.arg(theAttribute->attributeType());
     return false;
   }
 
@@ -839,7 +868,8 @@ bool SketchPlugin_ProjectionValidator::isValid(const AttributePtr& theAttribute,
   }
 
   if (!anEdge) {
-    theError = "The attribute " + theAttribute->id() + " should be an edge";
+    theError = "The attribute %1 should be an edge";
+    theError.arg(theAttribute->id());
     return false;
   }