Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
gettext.h File Reference
#include "config.h"
#include "porting.h"
#include "util/string.h"
#include <libintl.h>
+ Include dependency graph for gettext.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _(String)   gettext(String)
 
#define gettext_noop(String)   (String)
 
#define N_(String)   gettext_noop((String))
 

Functions

void init_gettext (const char *path, const std::string &configured_language, int argc, char *argv[])
 
std::string strgettext (const char *str)
 
std::string strgettext (const std::string &str)
 
std::wstring wstrgettext (const char *str)
 
std::wstring wstrgettext (const std::string &str)
 
template<typename ... Args>
std::wstring fwgettext (const char *src, Args &&... args)
 Returns translated string with format args applied.
 
template<typename ... Args>
std::string fmtgettext (const char *format, Args &&... args)
 Returns translated string with format args applied.
 

Macro Definition Documentation

◆ _

◆ gettext_noop

#define gettext_noop ( String)    (String)

◆ N_

Function Documentation

◆ fmtgettext()

template<typename ... Args>
std::string fmtgettext ( const char * format,
Args &&... args )
inline

Returns translated string with format args applied.

Template Parameters
ArgsTemplate parameter for format args
Parameters
formatTranslation source string
argsVariable format args
Returns
translated string.

References porting::mt_snprintf().

Referenced by Server::addShutdownError(), Game::checkConnection(), Game::connectToServer(), Game::createServer(), ShaderSource::generateShader(), ModConfiguration::getUnsatisfiedModsError(), Client::makeScreenshot(), KeyPress::name(), TextureBuffer::reset(), takeScreenshot(), and the_game().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fwgettext()

template<typename ... Args>
std::wstring fwgettext ( const char * src,
Args &&... args )
inline

Returns translated string with format args applied.

Template Parameters
ArgsTemplate parameter for format args
Parameters
srcTranslation source string
argsVariable format args
Warning
No dynamic sizing! string will be cut off if longer than 255 chars.
Returns
translated string

References wstrgettext().

Referenced by Game::decreaseViewRange(), Game::increaseViewRange(), GUIVolumeChange::OnEvent(), Game::processKeyInput(), GUIVolumeChange::regenerateGui(), and GameUI::toggleProfiler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_gettext()

void init_gettext ( const char * path,
const std::string & configured_language,
int argc,
char * argv[] )

References actionstream, errorstream, infostream, and lowercase().

Referenced by init_common().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strgettext() [1/2]

std::string strgettext ( const char * str)
inline

Referenced by Server::addShutdownError(), ModApiClient::l_gettext(), KeyPress::name(), TextureBuffer::reset(), GameFormSpec::showPauseMenu(), strgettext(), the_game(), and wstrgettext().

+ Here is the caller graph for this function:

◆ strgettext() [2/2]

std::string strgettext ( const std::string & str)
inline

References strgettext().

+ Here is the call graph for this function:

◆ wstrgettext() [1/2]

std::wstring wstrgettext ( const char * str)
inline

References strgettext(), and utf8_to_wide().

Referenced by GUITouchscreenLayout::GUITouchscreenLayout(), Client::afterContentReceived(), fwgettext(), Game::getServerContent(), ClientMediaDownloader::initialStep(), make_button_grid_title(), GUIFormSpecMenu::regenerateGui(), GUIOpenURLMenu::regenerateGui(), GUIPasswordChange::regenerateGui(), GUIVolumeChange::regenerateGui(), GUITouchscreenLayout::regenerateMenu(), Game::showOverlayMessage(), GameUI::showTranslatedStatusText(), GUIButtonKey::startCapture(), and wstrgettext().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wstrgettext() [2/2]

std::wstring wstrgettext ( const std::string & str)
inline

References wstrgettext().

+ Here is the call graph for this function: