24MRVIEWER_API std::string
translate( std::string_view context, std::string_view msg, LocaleDomainId domainId =
defaultDomain );
27MRVIEWER_API std::string
translate( std::string_view single, std::string_view plural, std::int64_t n, LocaleDomainId domainId =
defaultDomain );
30MRVIEWER_API std::string
translate( std::string_view context, std::string_view single, std::string_view plural, std::int64_t n, LocaleDomainId domainId =
defaultDomain );
35 std::vector<std::string> result;
36 result.reserve( items.size() );
37 for (
const auto& s : items )
38 result.push_back(
translate( s, domainId ) );
43inline std::vector<std::string>
translateAll(
const char* context,
const std::vector<std::string>& items, LocaleDomainId domainId =
defaultDomain )
45 std::vector<std::string> result;
46 result.reserve( items.size() );
47 for (
const auto& s : items )
48 result.push_back(
translate( context, s, domainId ) );
54#ifndef MR_NO_I18N_MACROS
55#define _tr( ... ) MR::Locale::translate( __VA_ARGS__ ).c_str()
56#define s_tr( ... ) MR::Locale::translate( __VA_ARGS__ )
57#define f_tr( ... ) fmt::runtime( MR::Locale::translate( __VA_ARGS__ ) )
Definition MRMeshFwd.h:803
constexpr LocaleDomainId defaultDomain
Locale domain internal identifier for MeshLib's own translations.
Definition MRI18n.h:16
std::vector< std::string > translateAll(const std::vector< std::string > &items, LocaleDomainId domainId=defaultDomain)
Translates all strings in a vector using the active locale.
Definition MRI18n.h:33
constexpr LocaleDomainId genericDomain
Locale domain internal identifier for cross-domain translations.
Definition MRI18n.h:18
std::string translate(std::string_view msg, LocaleDomainId domainId=defaultDomain)
Translates a message using the active locale.