TD: Translate default labels

This commit is contained in:
Chris Hennes
2023-08-12 16:25:34 -07:00
committed by WandererFan
parent 54bb9c9c62
commit 94426e1f54
8 changed files with 48 additions and 9 deletions

View File

@@ -335,7 +335,9 @@ void TaskLeaderLine::onLineStyleChanged()
void TaskLeaderLine::createLeaderFeature(std::vector<Base::Vector3d> converted)
{
// Base::Console().Message("TTL::createLeaderFeature()\n");
m_leaderName = m_basePage->getDocument()->getUniqueObjectName("LeaderLine");
const std::string objectName{QT_TR_NOOP("LeaderLine")};
std::string m_leaderName = m_basePage->getDocument()->getUniqueObjectName(objectName.c_str());
std::string generatedSuffix {m_leaderName.substr(objectName.length())};
m_leaderType = "TechDraw::DrawLeaderLine";
std::string PageName = m_basePage->getNameInDocument();
@@ -377,6 +379,9 @@ void TaskLeaderLine::createLeaderFeature(std::vector<Base::Vector3d> converted)
}
}
std::string translatedObjectName{tr(objectName.c_str()).toStdString()};
obj->Label.setValue(translatedObjectName + generatedSuffix);
Gui::Command::updateActive();
Gui::Command::commitCommand();