From 161cb7ac81e841ee7f2122bd2addb35e9c73d1df Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 10 Jun 2016 13:02:46 +0300 Subject: [PATCH] Translation of operations --- src/ExchangePlugin/CMakeLists.txt | 8 +- src/ExchangePlugin/ExchangePlugin_msg_en.ts | 31 +++ src/FeaturesPlugin/CMakeLists.txt | 10 +- .../FeaturesPlugin_Validators.cpp | 1 + src/FeaturesPlugin/FeaturesPlugin_msg_en.ts | 231 ++++++++++++++++++ src/PythonAddons/CMakeLists.txt | 5 + src/PythonAddons/PythonAddons_msg_en.ts | 11 + 7 files changed, 295 insertions(+), 2 deletions(-) create mode 100644 src/ExchangePlugin/ExchangePlugin_msg_en.ts create mode 100644 src/FeaturesPlugin/FeaturesPlugin_msg_en.ts create mode 100644 src/PythonAddons/PythonAddons_msg_en.ts diff --git a/src/ExchangePlugin/CMakeLists.txt b/src/ExchangePlugin/CMakeLists.txt index e92e026cb..2528e4bb3 100644 --- a/src/ExchangePlugin/CMakeLists.txt +++ b/src/ExchangePlugin/CMakeLists.txt @@ -31,6 +31,10 @@ SET(XML_RESOURCES plugin-Exchange.xml ) +SET(TEXT_RESOURCES + ExchangePlugin_msg_en.ts +) + SET(PROJECT_LIBRARIES Events Config @@ -38,15 +42,17 @@ SET(PROJECT_LIBRARIES GeomAPI GeomAlgoAPI ) +SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES}) ADD_DEFINITIONS(-DEXCHANGEPLUGIN_EXPORTS) -ADD_LIBRARY(ExchangePlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES}) +ADD_LIBRARY(ExchangePlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES}) TARGET_LINK_LIBRARIES(ExchangePlugin ${PROJECT_LIBRARIES}) INSTALL(TARGETS ExchangePlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES}) INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Exchange) +INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) ADD_UNIT_TESTS(TestImport.py TestExport.py) diff --git a/src/ExchangePlugin/ExchangePlugin_msg_en.ts b/src/ExchangePlugin/ExchangePlugin_msg_en.ts new file mode 100644 index 000000000..7eecf134f --- /dev/null +++ b/src/ExchangePlugin/ExchangePlugin_msg_en.ts @@ -0,0 +1,31 @@ + + + + + Import + + Model_FeatureValidator: Attribute "file_path" is not initialized. + Input file name for import + + + file_path - ExchangePlugin_ImportFormat: File name is empty. + Input file name for import + + + + + Export + + Model_FeatureValidator: Attribute "file_format" is not initialized. + Export file name is not defined + + + Model_FeatureValidator: Attribute "selection_list" is not initialized. + Objects for export are not selected + + + file_path - ExchangePlugin_ExportFormat: File name is empty. + Export file name is not defined + + + diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index bb7849f33..edd823596 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -73,6 +73,13 @@ SET(XML_RESOURCES remove_subshapes_widget.xml ) +SET(TEXT_RESOURCES + FeaturesPlugin_msg_en.ts +) + +SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES}) + + INCLUDE_DIRECTORIES( ../ModelAPI ../GeomAPI @@ -90,12 +97,13 @@ SET(PROJECT_LIBRARIES ) ADD_DEFINITIONS(-DFEATURESPLUGIN_EXPORTS) -ADD_LIBRARY(FeaturesPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES}) +ADD_LIBRARY(FeaturesPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES}) TARGET_LINK_LIBRARIES(FeaturesPlugin ${PROJECT_LIBRARIES}) INSTALL(TARGETS FeaturesPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES}) INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Features) +INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) ADD_UNIT_TESTS(TestExtrusion.py TestExtrusionCut.py diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index 2ab3adbb0..eb2017787 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -615,6 +615,7 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(const std::shared_pt // Copy base shape. GeomShapePtr aBaseShape = aShapeAttrSelection->value(); if(!aBaseShape.get()) { + theError = "Error: Base shape is empty."; return false; } GeomShapePtr aResultShape = aBaseShape->emptyCopied(); diff --git a/src/FeaturesPlugin/FeaturesPlugin_msg_en.ts b/src/FeaturesPlugin/FeaturesPlugin_msg_en.ts new file mode 100644 index 000000000..add80660a --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_msg_en.ts @@ -0,0 +1,231 @@ + + + + + Extrusion + + GeomValidators_ZeroOffset: FromSize = -ToSize and bounding planes are coincident. + Extrusion offset is not defined + + + Model_FeatureValidator: Attribute "base" is not initialized. + Base object for extrusion is not defined + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The object is empty + Sketch is not selected + + + GeomValidators_ZeroOffset: ToSize = -FromSize. + Extrusion offset is not defined + + + + + ExtrusionCut + + GeomValidators_ZeroOffset: FromSize = -ToSize and bounding planes are coincident. + Extrusion offset is not defined + + + Model_FeatureValidator: Attribute "base" is not initialized. + Base object for extrusion is not defined + + + main_objects - GeomValidators_ShapeType: It does not contain element with acceptable shape type. The type should be one of the next: + Objects for extrusion are not selected + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The object is empty + Sketch is not selected + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The result is empty + Sketch is not selected + + + + + Revolution + + GeomValidators_ZeroOffset: FromSize = -ToSize and bounding planes are coincident. + Angle offset is not defined + + + Model_FeatureValidator: Attribute "axis_object" is not initialized. + Revolution axis is not selected + + + axis_object - GeomValidators_ShapeType: The object is empty + Revolution axis is not selected + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The object is empty + Sketch is not selected + + + + + RevolutionCut + + GeomValidators_ZeroOffset: FromSize = -ToSize and bounding planes are coincident. + Angle offset is not defined + + + Model_FeatureValidator: Attribute "axis_object" is not initialized. + Revolution axis is not selected + + + axis_object - GeomValidators_ShapeType: The object is empty + Revolution axis is not selected + + + main_objects - GeomValidators_ShapeType: It does not contain element with acceptable shape type. The type should be one of the next: + Objects for revolution are not selected + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The object is empty + Sketch is not selected + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The result is empty + Sketch is not selected + + + + + ExtrusionFuse + + GeomValidators_ZeroOffset: FromSize = -ToSize and bounding planes are coincident. + Extrusion offset is not defined + + + Model_FeatureValidator: Attribute "base" is not initialized. + Base objects for extrusion are not selected + + + main_objects - GeomValidators_ShapeType: It does not contain element with acceptable shape type. The type should be one of the next: + Base objects for extrusion are not selected + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The object is empty + Sketch is not selected + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The result is empty + Sketch is not selected + + + + + RevolutionFuse + + GeomValidators_ZeroOffset: FromSize = -ToSize and bounding planes are coincident. + Offset angle is not defined + + + Model_FeatureValidator: Attribute "axis_object" is not initialized. + Rotation axis is not selected + + + axis_object - GeomValidators_ShapeType: The object is empty + Rotation axis is not selected + + + main_objects - GeomValidators_ShapeType: It does not contain element with acceptable shape type. The type should be one of the next: + Base objects for revolution are not selected + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The object is empty + Sketch is not selected + + + sketch - FeaturesPlugin_ValidatorCompositeLauncher: The result is empty + Sketch is not selected + + + + + Boolean + + GeomValidators_BooleanArguments: Not enough arguments + Not enough arguments for the operation + + + + + Partition + + GeomValidators_MinObjectsSelected: Error: Attribute "base_objects" should contain at least 2 items. + At least two objects has to be selected for the operation + + + + + Pipe + + Model_FeatureValidator: Attribute "base_objects" is not initialized. + Base object for pipe is not selected + + + Model_FeatureValidator: Attribute "binormal" is not initialized. + Binormal vector is not selected + + + Model_FeatureValidator: Attribute "path_object" is not initialized. + Object for pipe path is not selected + + + binormal - GeomValidators_ShapeType: The object is empty + Binormal vector is not selected + + + path_object - FeaturesPlugin_ValidatorPipePath: Error: Empty context. + Object for pipe path is not selected + + + + + Remove_SubShapes + + FeaturesPlugin_ValidatorRemoveSubShapesResult: Error: Base shape is empty. + Base shape is not selected + + + base_shape - GeomValidators_BodyShapes: Error: Context is empty. + Context object is not selected + + + subshapes - FeaturesPlugin_ValidatorRemoveSubShapesSelection: Error: Empty context. + Context object is not selected + + + + + Intersection + + Model_FeatureValidator: Attribute "main_objects" is not initialized. + Main object is not selected + + + Model_FeatureValidator: Attribute "tool_objects" is not initialized. + A tool object is not selected + + + + + Placement + + Model_FeatureValidator: Attribute "placement_centering" is not initialized. + + + + Model_FeatureValidator: Attribute "placement_end_shape" is not initialized. + + + + placement_end_shape - PartSet_DifferentObjects: The feature uses one shape in placement_end_shape and placement_start_shape attributes. + + + + diff --git a/src/PythonAddons/CMakeLists.txt b/src/PythonAddons/CMakeLists.txt index c50337a90..b6704ac65 100644 --- a/src/PythonAddons/CMakeLists.txt +++ b/src/PythonAddons/CMakeLists.txt @@ -3,6 +3,10 @@ SET(CMAKE_AUTOMOC ON) +SET(TEXT_RESOURCES + PythonAddons_msg_en.ts +) + # configuration IF(${HAVE_SALOME}) SET(ADDONS_FOLDER_PATH ../../../../bin/salome) @@ -21,3 +25,4 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/addons_Features.xml DESTINATION ${SHAP INSTALL(FILES __init__.py DESTINATION ${SHAPER_INSTALL_ADDONS}) INSTALL(DIRECTORY macros DESTINATION ${SHAPER_INSTALL_ADDONS}) INSTALL(DIRECTORY macros/box/icons/ macros/rectangle/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons) +INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) diff --git a/src/PythonAddons/PythonAddons_msg_en.ts b/src/PythonAddons/PythonAddons_msg_en.ts new file mode 100644 index 000000000..43ba4a107 --- /dev/null +++ b/src/PythonAddons/PythonAddons_msg_en.ts @@ -0,0 +1,11 @@ + + + + + Box + + Model_FeatureValidator: Attribute "height" is not initialized. + Height of the box is not defined + + + -- 2.39.2