MeshLib C++ Docs
Loading...
Searching...
No Matches
MRLocale.h File Reference
#include "config.h"
#include "exports.h"
#include "MRMesh/MRMeshFwd.h"
#include <boost/signals2/connection.hpp>
#include <filesystem>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  MR
 only for bindings generation
namespace  MR::Locale

Functions

const std::locale & MR::Locale::get ()
 Returns the active locale.
const std::string & MR::Locale::getName ()
 Returns the active locale's name.
const std::locale & MR::Locale::set (const std::string &localeName)
 Loads and sets the active locale by its name. UTF-8 is always used as an encoding.
boost::signals2::connection MR::Locale::onChanged (const std::function< void(const std::string &)> &cb)
 Connects to a signal emitted every time the active locale is changed.
std::vector< std::string > MR::Locale::getAvailableLocales ()
 Returns the list of the names of locales with available .mo files. "en" is always included as the default locale. The returned list is always sorted alphabetically.
void MR::Locale::addCatalogPath (const std::filesystem::path &path)
 Adds a path to .mo files. The path is expected to have the following directory structure: <locale name>/LC_MESSAGES/<domain name>.mo The active locale is reloaded on every call.
LocaleDomainId MR::Locale::addDomain (const char *domainName)
 Adds a new domain. The active locale is reloaded on every call.
LocaleDomainId MR::Locale::addDomain (const std::string &domainName)
 Adds a new domain. The active locale is reloaded on every call.
LocaleDomainId MR::Locale::findDomain (const char *domainName)
 Find an id for the given domain that can be passed to the translate functions.
LocaleDomainId MR::Locale::findDomain (const std::string &domainName)
 Find an id for the given domain that can be passed to the translate functions.
std::string MR::Locale::getDisplayName (const std::string &localeName)
 Returns a display name for the given locale.
void MR::Locale::setDisplayName (const std::string &localeName, const std::string &displayName)
 Adds or updates a display name for the given locale.
std::vector< std::string > MR::Locale::getSystemLocales ()
 Returns a list of system locales. The first one in the list is always the active system locale.