Blender V4.5
blender::locale Namespace Reference

Classes

class  Info
 
struct  MessageKey
 
struct  MessageKeyRef
 
class  MOFile
 
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.messages"}
 
static std::unique_ptr< MOMessagesglobal_messages
 
static std::string global_full_name
 

Function Documentation

◆ free()

void blender::locale::free ( )

Definition at line 612 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 629 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 )

Definition at line 591 of file messages.cc.

References CLOG_ERROR, CLOG_INFO, free(), global_full_name, global_messages, info, and LOG.

Referenced by BLT_lang_set().

◆ is_lower_ascii()

static 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()

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

Definition at line 70 of file messages.cc.

◆ is_upper_ascii()

static 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()

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

Definition at line 52 of file messages.cc.

References is_upper_ascii().

◆ make_upper_ascii()

static 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 618 of file messages.cc.

References global_messages, and key.

Referenced by pgettext().

Variable Documentation

◆ global_full_name

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

Definition at line 589 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 588 of file messages.cc.

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

◆ LOG

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

Definition at line 38 of file messages.cc.

Referenced by init().