1 | /* $Id: VBoxNls.h 92068 2021-10-26 08:35:27Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox NLS.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2020 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | #ifndef MAIN_INCLUDED_VBoxNls_h
|
---|
20 | #define MAIN_INCLUDED_VBoxNls_h
|
---|
21 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
22 | # pragma once
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | #ifdef VBOX_WITH_MAIN_NLS
|
---|
26 |
|
---|
27 | #include <VBox/com/defs.h>
|
---|
28 | #include <VBox/com/ptr.h>
|
---|
29 | #include <VBox/com/string.h>
|
---|
30 | #include "VirtualBoxTranslator.h"
|
---|
31 |
|
---|
32 |
|
---|
33 | # define DECLARE_TRANSLATION_CONTEXT(ctx) \
|
---|
34 | struct ctx \
|
---|
35 | {\
|
---|
36 | static const char *tr(const char *pszSource, const char *pszComment = NULL, const size_t aNum = ~(size_t)0) \
|
---|
37 | { \
|
---|
38 | return VirtualBoxTranslator::translate(NULL, #ctx, pszSource, pszComment, aNum); \
|
---|
39 | } \
|
---|
40 | }
|
---|
41 | #else
|
---|
42 | # define DECLARE_TRANSLATION_CONTEXT(ctx) \
|
---|
43 | struct ctx \
|
---|
44 | {\
|
---|
45 | static const char *tr(const char *pszSource, const char *pszComment = NULL, const size_t aNum = ~(size_t)0) \
|
---|
46 | { \
|
---|
47 | NOREF(pszComment); \
|
---|
48 | NOREF(aNum); \
|
---|
49 | return pszSource; \
|
---|
50 | } \
|
---|
51 | }
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | #endif /* !MAIN_INCLUDED_VBoxNls_h */
|
---|
55 |
|
---|