Gui: Add translations for color bar labels

This commit is contained in:
Chris Hennes
2023-04-16 20:37:32 -05:00
parent 07a6c62aef
commit 9dba7f25e4
2 changed files with 8 additions and 2 deletions

View File

@@ -27,6 +27,8 @@
#include <Inventor/SbBox2f.h>
#include <Inventor/nodes/SoSeparator.h>
#include <QCoreApplication> // For translation functions
#include "SoFCColorBar.h"
@@ -40,6 +42,7 @@ class GuiExport SoFCColorGradient : public SoFCColorBarBase {
using inherited = SoFCColorBarBase;
SO_NODE_HEADER(Gui::SoFCColorGradient);
Q_DECLARE_TR_FUNCTIONS(SoFCColorGradient);
public:
static void initClass();
@@ -71,7 +74,7 @@ public:
*/
void customize(SoFCColorBarBase*) override;
/** Returns the name of the color bar. */
const char* getColorBarName() const override { return "Color Gradient"; }
const char* getColorBarName() const override { return tr("Color Gradient").toStdString().c_str(); }
protected:
/**

View File

@@ -26,6 +26,8 @@
#include <Inventor/SbBox2f.h>
#include <Inventor/nodes/SoSeparator.h>
#include <QCoreApplication> // For translation functions
#include "SoFCColorBar.h"
@@ -39,6 +41,7 @@ class GuiExport SoFCColorLegend : public SoFCColorBarBase {
using inherited = SoFCColorBarBase;
SO_NODE_HEADER(Gui::SoFCColorLegend);
Q_DECLARE_TR_FUNCTIONS(SoFCColorLegend);
public:
static void initClass();
@@ -66,7 +69,7 @@ public:
std::size_t countColors () const { return _currentLegend.hasNumberOfFields(); }
void customize(SoFCColorBarBase*) override { }
const char* getColorBarName() const override { return "Color Legend"; }
const char* getColorBarName() const override { return tr("Color Legend").toStdString().c_str(); }
// virtual void handleEvent(SoHandleEventAction * action);
// virtual void GLRenderBelowPath(SoGLRenderAction * action);