28MRVIEWER_API std::string
translate( std::string_view context, std::string_view single, std::string_view plural,
Int64 n, LocaleDomainId domainId =
cDefaultDomainId );
33 std::vector<std::string> result;
34 result.reserve( items.size() );
35 for (
const auto& s : items )
36 result.push_back(
translate( s, domainId ) );
41inline std::vector<std::string>
translateAll(
const char* context,
const std::vector<std::string>& items, LocaleDomainId domainId =
cDefaultDomainId )
43 std::vector<std::string> result;
44 result.reserve( items.size() );
45 for (
const auto& s : items )
46 result.push_back(
translate( context, s, domainId ) );
52#ifndef MR_NO_I18N_MACROS
53#ifndef MRVIEWER_NO_LOCALE
54 #define _tr( ... ) MR::Locale::translate( __VA_ARGS__ ).c_str()
55 #define s_tr( ... ) MR::Locale::translate( __VA_ARGS__ )
56 #define f_tr( ... ) fmt::runtime( MR::Locale::translate( __VA_ARGS__ ) )
58 #define _tr( ... ) MR::Locale::translate_noop( __VA_ARGS__ )
59 #define s_tr( ... ) std::string( MR::Locale::translate_noop( __VA_ARGS__ ) )
60 #define f_tr( ... ) fmt::runtime( MR::Locale::translate_noop( __VA_ARGS__ ) )
std::int64_t Int64
Definition MRMeshFwd.h:202
Definition MRMeshFwd.h:810
std::vector< std::string > translateAll(const std::vector< std::string > &items, LocaleDomainId domainId=cDefaultDomainId)
Translates all strings in a vector using the active locale.
Definition MRI18n.h:31
std::string translate(std::string_view msg, LocaleDomainId domainId=cDefaultDomainId)
Translates a message using the active locale.
constexpr LocaleDomainId cDefaultDomainId
Locale domain internal identifier for MeshLib's own translations.
Definition MRI18n.h:16