Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLI18N.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright(c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
18#ifndef __vtkMRMLI18N_h
19#define __vtkMRMLI18N_h
20
21// MRML includes
22#include "vtkMRML.h"
23
24// VTK includes
25#include <vtkObject.h>
26
28
32class VTK_MRML_EXPORT vtkMRMLI18N : public vtkObject
33{
34public:
35 vtkTypeMacro(vtkMRMLI18N, vtkObject);
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
41
48 static vtkMRMLI18N* New();
49
51 static std::string Translate(const char* context, const char* sourceText, const char* disambiguation = nullptr, int n = -1);
52
66 static std::string Format(const std::string& text,
67 const char* arg1 = nullptr,
68 const char* arg2 = nullptr,
69 const char* arg3 = nullptr,
70 const char* arg4 = nullptr,
71 const char* arg5 = nullptr,
72 const char* arg6 = nullptr,
73 const char* arg7 = nullptr,
74 const char* arg8 = nullptr,
75 const char* arg9 = nullptr);
76
80
83 vtkGetObjectMacro(Translator, vtkMRMLTranslator);
84
85protected:
87 ~vtkMRMLI18N() override;
89 void operator=(const vtkMRMLI18N&);
90
93 static void classInitialize();
94 static void classFinalize();
95
98
100};
101
103class VTK_MRML_EXPORT vtkMRMLI18NInitialize
104{
105public:
107
110
111private:
112 static unsigned int Count;
113};
114
119
121#define vtkMRMLTr(context, sourceText) vtkMRMLI18N::Translate(context, sourceText)
122
123#endif
Utility class to make sure qSlicerModuleManager is initialized before it is used.
vtkMRMLI18NInitialize Self
static void classFinalize()
vtkMRMLI18N Self
Definition vtkMRMLI18N.h:97
~vtkMRMLI18N() override
vtkMRMLI18N(const vtkMRMLI18N &)
static void classInitialize()
Singleton management functions.
static vtkMRMLI18N * New()
vtkMRMLTranslator * Translator
Definition vtkMRMLI18N.h:99
static vtkMRMLI18N * GetInstance()
Return the singleton instance with no reference counting.
void SetTranslator(vtkMRMLTranslator *translator)
static std::string Format(const std::string &text, const char *arg1=nullptr, const char *arg2=nullptr, const char *arg3=nullptr, const char *arg4=nullptr, const char *arg5=nullptr, const char *arg6=nullptr, const char *arg7=nullptr, const char *arg8=nullptr, const char *arg9=nullptr)
friend class vtkMRMLI18NInitialize
Definition vtkMRMLI18N.h:96
static std::string Translate(const char *context, const char *sourceText, const char *disambiguation=nullptr, int n=-1)
Translate message with the current translator.
void PrintSelf(ostream &os, vtkIndent indent) override
void operator=(const vtkMRMLI18N &)
Base class for localization of messages that may be displayed to users.
static vtkMRMLI18NInitialize vtkMRMLI18NInitializer