forked from Slicer/Slicer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add translation function for logic classes
- Loading branch information
Showing
7 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <QCoreApplication> | ||
|
||
#include "qMRMLTranslator.h" | ||
|
||
std::string qMRMLTranslator::Translate(const char *context, const char *sourceText, const char *disambiguation, int n) | ||
{ | ||
return QCoreApplication::translate(context, sourceText, disambiguation, n).toStdString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef qMRMLTranslator_h | ||
#define qMRMLTranslator_h | ||
|
||
#include "vtkMRMLTranslator.h" | ||
|
||
#include "qSlicerBaseQTCoreExport.h" | ||
|
||
class Q_SLICER_BASE_QTCORE_EXPORT qMRMLTranslator: public vtkMRMLTranslator | ||
{ | ||
public: | ||
|
||
/// Translation function for logic classes | ||
std::string Translate(const char *context, const char *sourceText, const char *disambiguation = nullptr, int n = -1) override; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "vtkMRMLTranslator.h" | ||
|
||
std::string vtkMRMLTranslator::Translate(const char *vtkNotUsed(context), const char *sourceText, const char *vtkNotUsed(disambiguation), int vtkNotUsed(n)) | ||
{ | ||
return sourceText; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef vtkMRMLTranslator_h | ||
#define vtkMRMLTranslator_h | ||
|
||
#include "vtkMRMLLogicExport.h" | ||
|
||
// STD includes | ||
|
||
#include <string> | ||
|
||
class VTK_MRML_LOGIC_EXPORT vtkMRMLTranslator | ||
{ | ||
public: | ||
|
||
/// Default noop translation function for logic classes | ||
virtual std::string Translate(const char *context, const char *sourceText, const char *disambiguation = nullptr, int n = -1); | ||
}; | ||
|
||
#endif |