[TD]add label translation for Page and Template

This commit is contained in:
wandererfan
2023-08-17 17:26:08 -04:00
committed by WandererFan
parent 414e06d54d
commit 49a9442d61
14 changed files with 152 additions and 21 deletions

View File

@@ -43,7 +43,6 @@
#include "DrawUtil.h"
#include "XMLQuery.h"
using namespace TechDraw;
PROPERTY_SOURCE(TechDraw::DrawSVGTemplate, TechDraw::DrawTemplate)
@@ -250,6 +249,12 @@ std::map<std::string, std::string> DrawSVGTemplate::getEditableTextsFromTemplate
return editables;
}
//! get a translated label string from the context (ex TaskActiveView), the base name (ex ActiveView) and
//! the unique name within the document (ex ActiveView001), and use it to update the Label property.
void DrawSVGTemplate::translateLabel(std::string context, std::string baseName, std::string uniqueName)
{
Label.setValue(DrawUtil::translateArbitrary(context, baseName, uniqueName));
}
// Python Template feature ---------------------------------------------------------
namespace App {