Luanti 5.11.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_

#define N_ ( String)    gettext_noop((String))

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::createSingleplayerServer(), ShaderSource::generateShader(), ModConfiguration::getUnsatisfiedModsError(), 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
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 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(), ShaderSource::generateShader(), ModApiClient::l_gettext(), Game::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

◆ wstrgettext() [2/2]

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

References wstrgettext().

+ Here is the call graph for this function: