Slicer 5.6
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
56
59 vtkGetObjectMacro (Translator, vtkMRMLTranslator);
60
61protected:
63 ~vtkMRMLI18N() override;
65 void operator=(const vtkMRMLI18N&);
66
69 static void classInitialize();
70 static void classFinalize();
71
74
75 vtkMRMLTranslator* Translator{ nullptr };
76};
77
79class VTK_MRML_EXPORT vtkMRMLI18NInitialize
80{
81public:
83
86private:
87 static unsigned int Count;
88};
89
94
96#define vtkMRMLTr(context, sourceText) vtkMRMLI18N::Translate(context, sourceText)
97
98#endif
Utility class to make sure qSlicerModuleManager is initialized before it is used.
Definition vtkMRMLI18N.h:80
vtkMRMLI18NInitialize Self
Definition vtkMRMLI18N.h:82
Class that provide internationalization (i18n) features, such as language translation or region-speci...
Definition vtkMRMLI18N.h:33
static void classFinalize()
vtkMRMLI18N Self
Definition vtkMRMLI18N.h:73
~vtkMRMLI18N() override
vtkMRMLI18N(const vtkMRMLI18N &)
static void classInitialize()
Singleton management functions.
static vtkMRMLI18N * New()
static vtkMRMLI18N * GetInstance()
Return the singleton instance with no reference counting.
void SetTranslator(vtkMRMLTranslator *translator)
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
Definition vtkMRMLI18N.h:93