QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_MOC_HEADERS})
IF (${UPDATE_TRANSLATION})
- SET(PROJECT_FILES ${PROJECT_SOURCES} ${ROJECT_HEADERS} )
+ SET(PROJECT_FILES ${PROJECT_SOURCES} ${PROJECT_HEADERS} )
QT5_CREATE_TRANSLATION(QM_RESOURCES
${PROJECT_FILES}
${TEXT_RESOURCES}
${PROJECT_SOURCES}
${PROJECT_HEADERS}
${PROJECT_AUTOMOC}
- ${TEXT_RESOURCES}
- ${QM_RESOURCES}
+ ${TEXT_RESOURCES}
+ ${QM_RESOURCES}
)
TARGET_LINK_LIBRARIES(ModuleBase GeomAPI ${PROJECT_LIBRARIES})
#include <QMessageBox>
+#include <ModuleBase_Tools.h>
+
#include <string>
#include <set>
#include <sstream>
std::string aNotActivatedNames;
if (!ModelAPI_Tools::allDocumentsActivated(aNotActivatedNames)) {
- QMessageBox::StandardButton aRes = QMessageBox::warning(0, QObject::tr("Warning"),
- QObject::tr("Selected objects can be used in Part documents which are not loaded: "
- "%1. Whould you like to continue?").arg(aNotActivatedNames.c_str()),
- QMessageBox::No | QMessageBox::Yes, QMessageBox::No);
+ static const std::string aMsgContext("ParametersPlugin");
+ static const std::string aMsgText =
+ "Selected objects can be used in Part documents which are not loaded: " +
+ std::string("%1. Would you like to continue?");
+ Events_InfoMessage aMsg(aMsgContext, aMsgText);
+ aMsg.arg(aNotActivatedNames.c_str());
+ QMessageBox::StandardButton aRes =
+ QMessageBox::warning(0, ModuleBase_Tools::translate(aMsgContext, "Warning"),
+ ModuleBase_Tools::translate(aMsg),
+ QMessageBox::No | QMessageBox::Yes, QMessageBox::No);
if (aRes != QMessageBox::Yes) {
setParameterName(aResultParameter, aMessage->oldName());
return;
myTable = new ParametersPlugin_TreeWidget(this);
myTable->setColumnCount(4);
QStringList aHeaders;
- aHeaders << tr("Name") << tr("Expression") << tr("Result") << tr("Comment");
+ aHeaders << translate("Name") << translate("Expression")
+ << translate("Result") << translate("Comment");
myTable->setHeaderLabels(aHeaders);
myTable->setColumnWidth(Col_Name, 200);
myTable->setColumnWidth(Col_Equation, 100);
// Define root nodes
QStringList aNames;
- aNames<<tr("Parameters");
+ aNames<<translate("Parameters");
myParameters = new QTreeWidgetItem(aNames);
myParameters->setFlags(Qt::ItemIsEnabled);
myTable->addTopLevelItem(myParameters);
aNames.clear();
- aNames<<tr("Features");
+ aNames<<translate("Features");
myFeatures = new QTreeWidgetItem(aNames);
myFeatures->setFlags(Qt::ItemIsEnabled);
myTable->addTopLevelItem(myFeatures);
aBtnLayout->addStretch();
- myAddBtn = new QPushButton(tr("Add"), this);
+ myAddBtn = new QPushButton(translate("Add"), this);
connect(myAddBtn, SIGNAL(clicked(bool)), SLOT(onAdd()));
aBtnLayout->addWidget(myAddBtn);
- myInsertBtn = new QPushButton(tr("Insert"), this);
+ myInsertBtn = new QPushButton(translate("Insert"), this);
connect(myInsertBtn, SIGNAL(clicked(bool)), SLOT(onInsert()));
aBtnLayout->addWidget(myInsertBtn);
- myRemoveBtn = new QPushButton(tr("Remove"), this);
+ myRemoveBtn = new QPushButton(translate("Remove"), this);
connect(myRemoveBtn, SIGNAL(clicked(bool)), SLOT(onRemove()));
aBtnLayout->addWidget(myRemoveBtn);
QWidget* aBtnParentWgt = myOkCancelBtn->parentWidget();
QHBoxLayout* aBtnParentLayout = dynamic_cast<QHBoxLayout*>(aBtnParentWgt->layout());
- QPushButton* aPreviewBtn = new QPushButton(tr("See preview"), aBtnParentWgt);
+ QPushButton* aPreviewBtn = new QPushButton(translate("See preview"), aBtnParentWgt);
aBtnParentLayout->insertWidget(0, aPreviewBtn);
aBtnParentLayout->insertStretch(1, 1);
connect(aPreviewBtn, SIGNAL(clicked(bool)), SLOT(onShowPreview()));
int aId = 0;
foreach(FeaturePtr aFeature, myParametersList) {
if (!aValidator.isValid(aFeature->attribute(aAttrId), aArgs, aErr)) {
- // TODO(spo): translate
- QMessageBox::warning(this, tr("Warning"), aErr.messageString().c_str());
+ QMessageBox::warning(this, translate("Warning"), aErr.messageString().c_str());
selectItemScroll(myParameters->child(aId));
return false;
}
aText.replace(" ", "");
}
if (hasName(aText)) {
- myMessage = tr("Name '%1' already exists.").arg(aText);
+ myMessage = translate("Name '%1' already exists.").arg(aText);
QTimer::singleShot(50, this, SLOT(sendWarning()));
return;
}
void ParametersPlugin_WidgetParamsMgr::sendWarning()
{
- QMessageBox::warning(this, tr("Warning"), myMessage);
+ QMessageBox::warning(this, translate("Warning"), myMessage);
QTreeWidgetItem* aItem = myTable->currentItem();
if (aItem)
myTable->editItem(aItem);
<translation>AA</translation>
</message>
</context>
+ <context>
+ <name>ParametersMgr</name>
+ <message>
+ <source>Add</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <source>Comment</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <source>Expression</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <source>Features</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <source>Insert</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <source>Name</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <source>Remove</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <source>Result</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <source>See preview</source>
+ <translation>AA</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>ParametersPlugin</name>
+ <message>
+ <source>Warning</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <source>Selected objects can be used in Part documents which are not loaded: %1. Would you like to continue?</source>
+ <translation>AA</translation>
+ </message>
+ </context>
</TS>
# additional preprocessor / compiler flags
ADD_DEFINITIONS(${QT_DEFINITIONS})
+SET(UPDATE_TRANSLATION OFF)
+
SET(PROJECT_HEADERS
SHAPER_SHAPERGUI.h
SHAPERGUI.h
SHAPERGUI_OCCSelector.h
SHAPERGUI_SalomeViewer.h
SHAPERGUI_NestedButton.h
- SHAPERGUI_ToolbarsMgr.h
+ SHAPERGUI_ToolbarsMgr.h
)
SET(PROJECT_MOC_HEADERS
SHAPERGUI_DataModel.h
SHAPERGUI_NestedButton.h
SHAPERGUI_SalomeViewer.h
- SHAPERGUI_ToolbarsMgr.h
+ SHAPERGUI_ToolbarsMgr.h
)
# sources / moc wrappings
SHAPERGUI_OCCSelector.cpp
SHAPERGUI_SalomeViewer.cpp
SHAPERGUI_NestedButton.cpp
- SHAPERGUI_ToolbarsMgr.cpp
+ SHAPERGUI_ToolbarsMgr.cpp
)
SET(PROJECT_RESOURCES
resources/shaper.png
)
+SET(TEXT_RESOURCES
+ SHAPERGUI_msg_fr.ts
+)
+
+IF (${UPDATE_TRANSLATION})
+ SET(PROJECT_FILES ${PROJECT_SOURCES} ${PROJECT_HEADERS} )
+ QT5_CREATE_TRANSLATION(QM_RESOURCES
+ ${PROJECT_FILES}
+ ${TEXT_RESOURCES}
+ OPTIONS -extensions cpp -no-recursive
+ )
+ELSE(${UPDATE_TRANSLATION})
+ QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+ENDIF(${UPDATE_TRANSLATION})
+
+
SET(PROJECT_LIBRARIES
Events
Config
${PROJECT_SOURCES}
${PROJECT_HEADERS}
${PROJECT_AUTOMOC}
+ ${QM_RESOURCES}
)
ADD_DEPENDENCIES(SHAPER XGUI)
INSTALL(TARGETS SHAPER DESTINATION ${SHAPER_INSTALL_BIN})
INSTALL(FILES ${PROJECT_RESOURCES} DESTINATION ${SHAPER_INSTALL_RESOURCES})
+INSTALL(FILES ${QM_RESOURCES} DESTINATION ${SHAPER_INSTALL_QM_RESOURCES})
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="fr_FR">
+ <context>
+ <name>SHAPERGUI</name>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="170"/>
+ <source>Inspection</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="171"/>
+ <source>Information</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="176"/>
+ <source>Show inspection window</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="177"/>
+ <source>What Is</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="183"/>
+ <source>Inspection tool</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="191"/>
+ <source>Edit toolbars of the module</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="193"/>
+ <source>Edit toolbars...</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="775"/>
+ <source>Viewer</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="777"/>
+ <source>Default selection</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="779"/>
+ <source>Faces</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="782"/>
+ <source>Edges</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="785"/>
+ <source>Vertices</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="789"/>
+ <source>Selection sensitivity</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="791"/>
+ <source>Vertex</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="793"/>
+ <source>Edge</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="796"/>
+ <source>Additional highlighting</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="798"/>
+ <source>In 3d mode</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="800"/>
+ <source>In 2d mode</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="803"/>
+ <source>Color scale</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="805"/>
+ <source>X position</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="810"/>
+ <source>Y position</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="815"/>
+ <source>Width</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="820"/>
+ <source>Height</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="825"/>
+ <source>Intervals number</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="830"/>
+ <source>Text height</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI.cpp" line="835"/>
+ <source>Text color</source>
+ <translation>AA</translation>
+ </message>
+ </context>
+ <context>
+ <name>SHAPERGUI_ToolbarItemsDlg</name>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="268"/>
+ <source>Edit toolbar</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="278"/>
+ <source>Toolbar name:</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="298"/>
+ <source>Out of toolbars:</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="333"/>
+ <source>In the toolbar:</source>
+ <translation>AA</translation>
+ </message>
+ </context>
+ <context>
+ <name>SHAPERGUI_ToolbarsDlg</name>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="88"/>
+ <source>Toolbars</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="103"/>
+ <source>Toolbars:</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="115"/>
+ <source>Number of commands out of toolbars:</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="125"/>
+ <source>Add...</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="126"/>
+ <source>Add a new empty toolbar to the toolbars list</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="130"/>
+ <source>Edit...</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="131"/>
+ <source>Edit currently selected toolbar</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="135"/>
+ <source>Delete</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="136"/>
+ <source>Delete currently selected toolbar</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="141"/>
+ <source>Reset</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="142"/>
+ <source>Restore default toolbars structure</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="163"/>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="172"/>
+ <source>Create toolbar</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="163"/>
+ <source>Name of a new toolbar</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="171"/>
+ <source>A tool bar with name %1 already exists</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="205"/>
+ <source>Toolbar %1 will be deleted. Continue?</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="206"/>
+ <source>Delete toolbar</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="SHAPERGUI_ToolbarsMgr.cpp" line="224"/>
+ <source> (%1 commands)</source>
+ <translation>AA</translation>
+ </message>
+ </context>
+</TS>
<section name="resources">
<!-- Module resources -->
<parameter name="SHAPER" value="%SHAPER_ROOT_DIR%/share/salome/resources/shaper"/>
+ <parameter name="SHAPERGUI" value="%SHAPER_ROOT_DIR%/share/salome/resources/shaper"/>
<parameter name="ModuleBase" value="%SHAPER_ROOT_DIR%/share/salome/resources/shaper"/>
<parameter name="PartSet" value="%SHAPER_ROOT_DIR%/share/salome/resources/shaper"/>
<parameter name="XGUI" value="%SHAPER_ROOT_DIR%/share/salome/resources/shaper"/>
if (aLabel) continue;
// Get the original tool tip of the widget
- QString aTTip = aWidget->toolTip().section("Errors:\n", 0, 0).trimmed();
+ QString aTTip = aWidget->toolTip().section(tr("Errors:") + "\n", 0, 0).trimmed();
// Add the error message into the tool tip
if (!theError.isEmpty()) {
if (!aTTip.isEmpty())
aTTip.append('\n');
- aTTip += "Errors:\n" + theError;
+ aTTip += tr("Errors:") + "\n" + theError;
}
aWidget->setToolTip(aTTip);
//aWidget->setStyleSheet(anError.isEmpty() ? "" : "background-color:pink;");
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_ContextMenuMgr.cpp" line="811"/>
+ <location filename="XGUI_ContextMenuMgr.cpp" line="806"/>
<source>Selection mode</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_ContextMenuMgr.cpp" line="864"/>
+ <location filename="XGUI_ContextMenuMgr.cpp" line="859"/>
<source>Windows</source>
<translation>AA</translation>
</message>
<translation>AA</translation>
</message>
</context>
+<context>
+ <name>XGUI_ErrorMgr</name>
+ <message>
+ <location filename="XGUI_ErrorMgr.cpp" line="204"/>
+ <location filename="XGUI_ErrorMgr.cpp" line="209"/>
+ <source>Errors:</source>
+ <translation>AA</translation>
+ </message>
+</context>
<context>
<name>XGUI_FacesPanel</name>
<message>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="930"/>
- <location filename="XGUI_Workshop.cpp" line="1029"/>
+ <location filename="XGUI_Workshop.cpp" line="931"/>
+ <location filename="XGUI_Workshop.cpp" line="1034"/>
<source>Save current file</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="931"/>
+ <location filename="XGUI_Workshop.cpp" line="932"/>
<source>The document is modified, save before opening another?</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="942"/>
+ <location filename="XGUI_Workshop.cpp" line="946"/>
<source>Open file</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1109"/>
+ <location filename="XGUI_Workshop.cpp" line="1115"/>
<source>Select name to save file...</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1772"/>
+ <location filename="XGUI_Workshop.cpp" line="1779"/>
<source>Show object</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1773"/>
+ <location filename="XGUI_Workshop.cpp" line="1780"/>
<source>'%1'
are hidden by %2:
Remove objects from the panel to be displayed?</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="956"/>
+ <location filename="XGUI_Workshop.cpp" line="961"/>
<source>Warning</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="956"/>
+ <location filename="XGUI_Workshop.cpp" line="961"/>
<source>Unable to open the file.</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1029"/>
+ <location filename="XGUI_Workshop.cpp" line="1034"/>
<source>The document is modified, save before exit?</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1241"/>
+ <location filename="XGUI_Workshop.cpp" line="1248"/>
<source>Information about module "%1" doesn't exist.</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="1402"/>
+ <location filename="XGUI_Workshop.cpp" line="1409"/>
<source>Object browser</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="2005"/>
+ <location filename="XGUI_Workshop.cpp" line="2026"/>
<source>All features are relevant, there is nothing to be deleted</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="2827"/>
+ <location filename="XGUI_Workshop.cpp" line="2480"/>
+ <source>Transparency</source>
+ <translation>AA</translation>
+ </message>
+ <message>
+ <location filename="XGUI_Workshop.cpp" line="2860"/>
<source>Find results</source>
<translation>AA</translation>
</message>
<message>
- <location filename="XGUI_Workshop.cpp" line="2828"/>
+ <location filename="XGUI_Workshop.cpp" line="2861"/>
<source>Results not found</source>
<translation>AA</translation>
</message>