Blender V5.0
blt_translation.cc File Reference
#include <cstdlib>
#include <cstring>
#include <optional>
#include "BLT_translation.hh"
#include "DNA_userdef_types.h"

Go to the source code of this file.

Functions

bool BLT_is_default_context (const StringRef msgctxt)
static std::optional< StringRefNullpgettext (StringRef msgctxt, const StringRef msgid)
const char * BLT_pgettext (const char *msgctxt, const char *msgid)
blender::StringRef BLT_pgettext (blender::StringRef msgctxt, blender::StringRef msgid)
bool BLT_translate ()
bool BLT_translate_iface ()
bool BLT_translate_tooltips ()
bool BLT_translate_reports ()
bool BLT_translate_new_dataname ()
template<typename StringT>
StringT translate_do (StringT msgctxt, StringT msgid)
const char * BLT_translate_do (const char *msgctxt, const char *msgid)
StringRef BLT_translate_do (StringRef msgctxt, StringRef msgid)
template<typename StringT>
StringT translate_do_iface (StringT msgctxt, StringT msgid)
const char * BLT_translate_do_iface (const char *msgctxt, const char *msgid)
StringRef BLT_translate_do_iface (StringRef msgctxt, StringRef msgid)
template<typename StringT>
StringT translate_do_tooltip (StringT msgctxt, StringT msgid)
const char * BLT_translate_do_tooltip (const char *msgctxt, const char *msgid)
StringRef BLT_translate_do_tooltip (StringRef msgctxt, StringRef msgid)
template<typename StringT>
StringT translate_do_report (StringT msgctxt, StringT msgid)
const char * BLT_translate_do_report (const char *msgctxt, const char *msgid)
StringRef BLT_translate_do_report (StringRef msgctxt, StringRef msgid)
template<typename StringT>
StringT translate_do_new_dataname (StringT msgctxt, StringT msgid)
const char * BLT_translate_do_new_dataname (const char *msgctxt, const char *msgid)
StringRef BLT_translate_do_new_dataname (StringRef msgctxt, StringRef msgid)

Detailed Description

Manages translation files and provides translation functions. (which are optional and can be disabled as a preference).

Definition in file blt_translation.cc.

Function Documentation

◆ BLT_is_default_context()

bool BLT_is_default_context ( const StringRef msgctxt)

Definition at line 32 of file blt_translation.cc.

References BLT_I18NCONTEXT_DEFAULT_BPYRNA, and blender::StringRefBase::is_empty().

Referenced by pgettext().

◆ BLT_pgettext() [1/2]

blender::StringRef BLT_pgettext ( blender::StringRef msgctxt,
blender::StringRef msgid )

Definition at line 73 of file blt_translation.cc.

References pgettext().

◆ BLT_pgettext() [2/2]

const char * BLT_pgettext ( const char * msgctxt,
const char * msgid )

◆ BLT_translate()

◆ BLT_translate_do() [1/2]

const char * BLT_translate_do ( const char * msgctxt,
const char * msgid )

Definition at line 142 of file blt_translation.cc.

References translate_do().

◆ BLT_translate_do() [2/2]

StringRef BLT_translate_do ( StringRef msgctxt,
StringRef msgid )

Definition at line 147 of file blt_translation.cc.

References translate_do().

◆ BLT_translate_do_iface() [1/2]

const char * BLT_translate_do_iface ( const char * msgctxt,
const char * msgid )

◆ BLT_translate_do_iface() [2/2]

StringRef BLT_translate_do_iface ( StringRef msgctxt,
StringRef msgid )

Definition at line 172 of file blt_translation.cc.

References translate_do_iface().

◆ BLT_translate_do_new_dataname() [1/2]

const char * BLT_translate_do_new_dataname ( const char * msgctxt,
const char * msgid )

Definition at line 242 of file blt_translation.cc.

References translate_do_new_dataname().

Referenced by app_translations_pgettext_data().

◆ BLT_translate_do_new_dataname() [2/2]

StringRef BLT_translate_do_new_dataname ( StringRef msgctxt,
StringRef msgid )

Definition at line 247 of file blt_translation.cc.

References translate_do_new_dataname().

◆ BLT_translate_do_report() [1/2]

const char * BLT_translate_do_report ( const char * msgctxt,
const char * msgid )

Definition at line 217 of file blt_translation.cc.

References translate_do_report().

Referenced by app_translations_pgettext_rpt().

◆ BLT_translate_do_report() [2/2]

StringRef BLT_translate_do_report ( StringRef msgctxt,
StringRef msgid )

Definition at line 222 of file blt_translation.cc.

References translate_do_report().

◆ BLT_translate_do_tooltip() [1/2]

const char * BLT_translate_do_tooltip ( const char * msgctxt,
const char * msgid )

◆ BLT_translate_do_tooltip() [2/2]

StringRef BLT_translate_do_tooltip ( StringRef msgctxt,
StringRef msgid )

Definition at line 197 of file blt_translation.cc.

References translate_do_tooltip().

◆ BLT_translate_iface()

bool BLT_translate_iface ( )

Definition at line 91 of file blt_translation.cc.

References BLT_translate(), U, and USER_TR_IFACE.

Referenced by translate_do_iface().

◆ BLT_translate_new_dataname()

bool BLT_translate_new_dataname ( )

◆ BLT_translate_reports()

bool BLT_translate_reports ( )

Definition at line 109 of file blt_translation.cc.

References BLT_translate(), U, and USER_TR_REPORTS.

Referenced by translate_do_report().

◆ BLT_translate_tooltips()

bool BLT_translate_tooltips ( )

Definition at line 100 of file blt_translation.cc.

References BLT_translate(), U, and USER_TR_TOOLTIPS.

Referenced by translate_do_tooltip().

◆ pgettext()

std::optional< StringRefNull > pgettext ( StringRef msgctxt,
const StringRef msgid )
static

◆ translate_do()

template<typename StringT>
StringT translate_do ( StringT msgctxt,
StringT msgid )

Definition at line 127 of file blt_translation.cc.

References BLT_pgettext(), and BLT_translate().

Referenced by BLT_translate_do(), and BLT_translate_do().

◆ translate_do_iface()

template<typename StringT>
StringT translate_do_iface ( StringT msgctxt,
StringT msgid )

Definition at line 152 of file blt_translation.cc.

References BLT_pgettext(), and BLT_translate_iface().

Referenced by BLT_translate_do_iface(), and BLT_translate_do_iface().

◆ translate_do_new_dataname()

template<typename StringT>
StringT translate_do_new_dataname ( StringT msgctxt,
StringT msgid )

◆ translate_do_report()

template<typename StringT>
StringT translate_do_report ( StringT msgctxt,
StringT msgid )

Definition at line 202 of file blt_translation.cc.

References BLT_pgettext(), and BLT_translate_reports().

Referenced by BLT_translate_do_report(), and BLT_translate_do_report().

◆ translate_do_tooltip()

template<typename StringT>
StringT translate_do_tooltip ( StringT msgctxt,
StringT msgid )