Blender V5.0
blender::locale Namespace Reference

Classes

class  Info
class  MOFile
struct  MessageKeyRef
struct  MessageKey
class  MOMessages

Functions

static constexpr bool is_upper_ascii (const char c)
static constexpr bool is_lower_ascii (const char c)
static bool make_lower_ascii (char &c)
static bool make_upper_ascii (char &c)
static constexpr bool is_numeric_ascii (const char c)
bool operator== (const MessageKey &a, const MessageKey &b)
bool operator== (const MessageKeyRef &a, const MessageKey &b)
void init (const StringRef locale_full_name, const Vector< std::string > &domains, const Vector< std::string > &paths)
void free ()
std::optional< StringRefNulltranslate (const int domain, const StringRef context, const StringRef key)
const char * full_name ()
std::string macos_user_locale ()

Variables

static CLG_LogRef LOG = {"translation"}
static std::unique_ptr< MOMessagesglobal_messages
static std::string global_full_name

Function Documentation

◆ free()

void blender::locale::free ( )

Definition at line 614 of file messages.cc.

References global_full_name, and global_messages.

Referenced by BLT_lang_free(), and init().

◆ full_name()

const char * blender::locale::full_name ( )

Definition at line 631 of file messages.cc.

References global_full_name.

Referenced by BLT_lang_get().

◆ init()

void blender::locale::init ( const StringRef locale_full_name,
const Vector< std::string > & domains,
const Vector< std::string > & paths )

◆ is_lower_ascii()

constexpr bool blender::locale::is_lower_ascii ( const char c)
staticconstexpr

Definition at line 47 of file messages.cc.

Referenced by make_upper_ascii().

◆ is_numeric_ascii()

constexpr bool blender::locale::is_numeric_ascii ( const char c)
staticconstexpr

Definition at line 70 of file messages.cc.

◆ is_upper_ascii()

constexpr bool blender::locale::is_upper_ascii ( const char c)
staticconstexpr

Definition at line 42 of file messages.cc.

Referenced by make_lower_ascii().

◆ macos_user_locale()

std::string blender::locale::macos_user_locale ( )

Definition at line 20 of file messages_apple.mm.

References result.

Referenced by blender::locale::Info::Info().

◆ make_lower_ascii()

bool blender::locale::make_lower_ascii ( char & c)
static

Definition at line 52 of file messages.cc.

References is_upper_ascii().

◆ make_upper_ascii()

bool blender::locale::make_upper_ascii ( char & c)
static

Definition at line 61 of file messages.cc.

References is_lower_ascii().

◆ operator==() [1/2]

bool blender::locale::operator== ( const MessageKey & a,
const MessageKey & b )
inline

◆ operator==() [2/2]

bool blender::locale::operator== ( const MessageKeyRef & a,
const MessageKey & b )
inline

◆ translate()

std::optional< StringRefNull > blender::locale::translate ( const int domain,
const StringRef context,
const StringRef key )

Definition at line 620 of file messages.cc.

References global_messages.

Referenced by pgettext().

Variable Documentation

◆ global_full_name

std::string blender::locale::global_full_name
static

Definition at line 591 of file messages.cc.

Referenced by free(), full_name(), and init().

◆ global_messages

std::unique_ptr<MOMessages> blender::locale::global_messages
static

Definition at line 590 of file messages.cc.

Referenced by free(), init(), and translate().

◆ LOG

CLG_LogRef blender::locale::LOG = {"translation"}
static

Definition at line 38 of file messages.cc.

Referenced by init().