MeshLib C++ Docs
Loading...
Searching...
No Matches
MRI18n.h File Reference
#include "config.h"
#include "exports.h"
#include "MRMesh/MRId.h"
#include <string>
#include <string_view>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  MR
 only for bindings generation
namespace  MR::Locale

Macros

#define _tr(...)
#define s_tr(...)
#define f_tr(...)

Functions

std::string MR::Locale::translate (std::string_view msg, LocaleDomainId domainId=cDefaultDomainId)
 Translates a message using the active locale.
std::string MR::Locale::translate (std::string_view context, std::string_view msg, LocaleDomainId domainId=cDefaultDomainId)
 Translates a message in context using the active locale.
std::string MR::Locale::translate (std::string_view single, std::string_view plural, Int64 n, LocaleDomainId domainId=cDefaultDomainId)
 Translates a plural message form using the active locale.
std::string MR::Locale::translate (std::string_view context, std::string_view single, std::string_view plural, Int64 n, LocaleDomainId domainId=cDefaultDomainId)
 Translates a plural message form in context using the active locale.
std::vector< std::string > MR::Locale::translateAll (const std::vector< std::string > &items, LocaleDomainId domainId=cDefaultDomainId)
 Translates all strings in a vector using the active locale.
std::vector< std::string > MR::Locale::translateAll (const char *context, const std::vector< std::string > &items, LocaleDomainId domainId=cDefaultDomainId)
 Translates all strings in a vector with context using the active locale.

Variables

constexpr LocaleDomainId MR::Locale::cDefaultDomainId { 0 }
 Locale domain internal identifier for MeshLib's own translations.

Macro Definition Documentation

◆ _tr

#define _tr ( ...)
Value:
MR::Locale::translate( __VA_ARGS__ ).c_str()
std::string translate(std::string_view msg, LocaleDomainId domainId=cDefaultDomainId)
Translates a message using the active locale.

◆ f_tr

#define f_tr ( ...)
Value:
fmt::runtime( MR::Locale::translate( __VA_ARGS__ ) )

◆ s_tr

#define s_tr ( ...)
Value:
MR::Locale::translate( __VA_ARGS__ )