From: mpv Date: Fri, 20 Sep 2019 07:21:58 +0000 (+0300) Subject: Update translations in particular cases. X-Git-Tag: V9_4_0a2~4^2~79 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1a58ed3e02d9b4ab3715425dcb63b7ec83f421d0;p=modules%2Fshaper.git Update translations in particular cases. --- diff --git a/src/ModuleBase/CMakeLists.txt b/src/ModuleBase/CMakeLists.txt index 0c35b26a5..59caaee93 100644 --- a/src/ModuleBase/CMakeLists.txt +++ b/src/ModuleBase/CMakeLists.txt @@ -254,7 +254,7 @@ SET(PROJECT_LIBRARIES 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} @@ -288,8 +288,8 @@ ADD_LIBRARY(ModuleBase SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${PROJECT_AUTOMOC} - ${TEXT_RESOURCES} - ${QM_RESOURCES} + ${TEXT_RESOURCES} + ${QM_RESOURCES} ) TARGET_LINK_LIBRARIES(ModuleBase GeomAPI ${PROJECT_LIBRARIES}) diff --git a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp index 513cabf11..718fa3f43 100644 --- a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp +++ b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp @@ -40,6 +40,8 @@ #include +#include + #include #include #include @@ -282,10 +284,16 @@ void ParametersPlugin_EvalListener::processObjectRenamedEvent( 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; diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index d03062163..6b0dc115c 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -186,7 +186,8 @@ ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theP 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); @@ -209,13 +210,13 @@ ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theP // Define root nodes QStringList aNames; - aNames<setFlags(Qt::ItemIsEnabled); myTable->addTopLevelItem(myParameters); aNames.clear(); - aNames<setFlags(Qt::ItemIsEnabled); myTable->addTopLevelItem(myFeatures); @@ -234,15 +235,15 @@ ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theP 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); @@ -258,7 +259,7 @@ void ParametersPlugin_WidgetParamsMgr::setDialogButtons(QDialogButtonBox* theBut QWidget* aBtnParentWgt = myOkCancelBtn->parentWidget(); QHBoxLayout* aBtnParentLayout = dynamic_cast(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())); @@ -293,8 +294,7 @@ bool ParametersPlugin_WidgetParamsMgr::storeValueCustom() 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; } @@ -486,7 +486,7 @@ void ParametersPlugin_WidgetParamsMgr::onCloseEditor(QWidget* theEditor, 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; } @@ -768,7 +768,7 @@ bool ParametersPlugin_WidgetParamsMgr::hasName(const QString& theName) const 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); diff --git a/src/ParametersPlugin/ParametersPlugin_msg_fr.ts b/src/ParametersPlugin/ParametersPlugin_msg_fr.ts index ac9272ef0..8a712b430 100644 --- a/src/ParametersPlugin/ParametersPlugin_msg_fr.ts +++ b/src/ParametersPlugin/ParametersPlugin_msg_fr.ts @@ -95,5 +95,56 @@ AA + + ParametersMgr + + Add + AA + + + Comment + AA + + + Expression + AA + + + Features + AA + + + Insert + AA + + + Name + AA + + + Remove + AA + + + Result + AA + + + See preview + AA + + + + + ParametersPlugin + + Warning + AA + + + Selected objects can be used in Part documents which are not loaded: %1. Would you like to continue? + AA + + diff --git a/src/SHAPERGUI/CMakeLists.txt b/src/SHAPERGUI/CMakeLists.txt index 76831f99f..ecfe4194e 100644 --- a/src/SHAPERGUI/CMakeLists.txt +++ b/src/SHAPERGUI/CMakeLists.txt @@ -25,6 +25,8 @@ INCLUDE_DIRECTORIES(${QT_INCLUDES}) # additional preprocessor / compiler flags ADD_DEFINITIONS(${QT_DEFINITIONS}) +SET(UPDATE_TRANSLATION OFF) + SET(PROJECT_HEADERS SHAPER_SHAPERGUI.h SHAPERGUI.h @@ -32,7 +34,7 @@ SET(PROJECT_HEADERS SHAPERGUI_OCCSelector.h SHAPERGUI_SalomeViewer.h SHAPERGUI_NestedButton.h - SHAPERGUI_ToolbarsMgr.h + SHAPERGUI_ToolbarsMgr.h ) SET(PROJECT_MOC_HEADERS @@ -40,7 +42,7 @@ SET(PROJECT_MOC_HEADERS SHAPERGUI_DataModel.h SHAPERGUI_NestedButton.h SHAPERGUI_SalomeViewer.h - SHAPERGUI_ToolbarsMgr.h + SHAPERGUI_ToolbarsMgr.h ) # sources / moc wrappings @@ -52,7 +54,7 @@ SET(PROJECT_SOURCES SHAPERGUI_OCCSelector.cpp SHAPERGUI_SalomeViewer.cpp SHAPERGUI_NestedButton.cpp - SHAPERGUI_ToolbarsMgr.cpp + SHAPERGUI_ToolbarsMgr.cpp ) SET(PROJECT_RESOURCES @@ -61,6 +63,22 @@ 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 @@ -98,6 +116,7 @@ ADD_LIBRARY(SHAPER SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${PROJECT_AUTOMOC} + ${QM_RESOURCES} ) ADD_DEPENDENCIES(SHAPER XGUI) @@ -113,3 +132,4 @@ CONFIGURE_FILE( INSTALL(TARGETS SHAPER DESTINATION ${SHAPER_INSTALL_BIN}) INSTALL(FILES ${PROJECT_RESOURCES} DESTINATION ${SHAPER_INSTALL_RESOURCES}) +INSTALL(FILES ${QM_RESOURCES} DESTINATION ${SHAPER_INSTALL_QM_RESOURCES}) diff --git a/src/SHAPERGUI/SHAPERGUI_msg_fr.ts b/src/SHAPERGUI/SHAPERGUI_msg_fr.ts new file mode 100644 index 000000000..0497e8c34 --- /dev/null +++ b/src/SHAPERGUI/SHAPERGUI_msg_fr.ts @@ -0,0 +1,249 @@ + + + + + SHAPERGUI + + + Inspection + AA + + + + Information + AA + + + + Show inspection window + AA + + + + What Is + AA + + + + Inspection tool + AA + + + + Edit toolbars of the module + AA + + + + Edit toolbars... + AA + + + + Viewer + AA + + + + Default selection + AA + + + + Faces + AA + + + + Edges + AA + + + + Vertices + AA + + + + Selection sensitivity + AA + + + + Vertex + AA + + + + Edge + AA + + + + Additional highlighting + AA + + + + In 3d mode + AA + + + + In 2d mode + AA + + + + Color scale + AA + + + + X position + AA + + + + Y position + AA + + + + Width + AA + + + + Height + AA + + + + Intervals number + AA + + + + Text height + AA + + + + Text color + AA + + + + SHAPERGUI_ToolbarItemsDlg + + + Edit toolbar + AA + + + + Toolbar name: + AA + + + + Out of toolbars: + AA + + + + In the toolbar: + AA + + + + SHAPERGUI_ToolbarsDlg + + + Toolbars + AA + + + + Toolbars: + AA + + + + Number of commands out of toolbars: + AA + + + + Add... + AA + + + + Add a new empty toolbar to the toolbars list + AA + + + + Edit... + AA + + + + Edit currently selected toolbar + AA + + + + Delete + AA + + + + Delete currently selected toolbar + AA + + + + Reset + AA + + + + Restore default toolbars structure + AA + + + + + Create toolbar + AA + + + + Name of a new toolbar + AA + + + + A tool bar with name %1 already exists + AA + + + + Toolbar %1 will be deleted. Continue? + AA + + + + Delete toolbar + AA + + + + (%1 commands) + AA + + + diff --git a/src/SHAPERGUI/resources/LightApp.xml.in b/src/SHAPERGUI/resources/LightApp.xml.in index b2c131899..081f2b03e 100644 --- a/src/SHAPERGUI/resources/LightApp.xml.in +++ b/src/SHAPERGUI/resources/LightApp.xml.in @@ -17,6 +17,7 @@
+ diff --git a/src/XGUI/XGUI_ErrorMgr.cpp b/src/XGUI/XGUI_ErrorMgr.cpp index 1f945e65d..40ba05054 100644 --- a/src/XGUI/XGUI_ErrorMgr.cpp +++ b/src/XGUI/XGUI_ErrorMgr.cpp @@ -201,12 +201,12 @@ void XGUI_ErrorMgr::updateToolTip(ModuleBase_ModelWidget* theWidget, 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;"); diff --git a/src/XGUI/XGUI_msg_fr.ts b/src/XGUI/XGUI_msg_fr.ts index 61c713ad3..63244d65b 100644 --- a/src/XGUI/XGUI_msg_fr.ts +++ b/src/XGUI/XGUI_msg_fr.ts @@ -208,12 +208,12 @@ AA - + Selection mode AA - + Windows AA @@ -242,6 +242,15 @@ AA + + XGUI_ErrorMgr + + + + Errors: + AA + + XGUI_FacesPanel @@ -698,75 +707,80 @@ AA - - + + Save current file AA - + The document is modified, save before opening another? AA - + Open file AA - + Select name to save file... AA - + Show object AA - + '%1' are hidden by %2: Remove objects from the panel to be displayed? AA - + Warning AA - + Unable to open the file. AA - + The document is modified, save before exit? AA - + Information about module "%1" doesn't exist. AA - + Object browser AA - + All features are relevant, there is nothing to be deleted AA - + + Transparency + AA + + + Find results AA - + Results not found AA