MeshLib C++ Docs
Loading...
Searching...
No Matches
MRI18n.h
Go to the documentation of this file.
1#pragma once
2
3#include "config.h"
4#ifndef MRVIEWER_NO_LOCALE
5#include "exports.h"
6
7#include <MRMesh/MRMeshFwd.h>
8
9#include <string>
10
11namespace MR::Locale
12{
13
15MRVIEWER_API std::string translate( const char* msg, int domainId = 0 );
16
18MRVIEWER_API std::string translate( const char* context, const char* msg, int domainId = 0 );
19
21MRVIEWER_API std::string translate( const char* single, const char* plural, Int64 n, int domainId = 0 );
22
24MRVIEWER_API std::string translate( const char* context, const char* single, const char* plural, Int64 n, int domainId = 0 );
25
26}
27
28#ifndef MR_NO_I18N_MACROS
29#define _tr( ... ) MR::Locale::translate( __VA_ARGS__ ).c_str()
30#define f_tr( ... ) fmt::runtime( MR::Locale::translate( __VA_ARGS__ ) )
31#endif
32
33#else
34
35#ifndef MR_NO_I18N_MACROS
36#define _tr( ... ) MR::Locale::translate_noop( __VA_ARGS__ )
37#define f_tr( ... ) fmt::runtime( MR::Locale::translate_noop( __VA_ARGS__ ) )
38#endif
39
40#endif
std::int64_t Int64
Definition MRMeshFwd.h:200
Definition MRMeshFwd.h:805
std::string translate(const char *msg, int domainId=0)
Translates a message using the active locale.