Functions

gettext.cpp File Reference

#include "global.hpp"
#include "gettext.hpp"
#include <cstring>
Include dependency graph for gettext.cpp:

Go to the source code of this file.

Functions

char const * egettext (char const *msgid)
 How to use gettext for wesnoth source files:

  1. include this header file in the .cpp file
  2. make sure, that the source file is listed in the respective POTFILES.in for the textdomain, in the case of wesnoth-lib it is this file: po/wesnoth-lib/POTFILES.in
  3. add the following include to set the correct textdomain, in this example wesnoth-lib (not required for the domain 'wesnoth', required for all other textdomains).

const char * sgettext (const char *msgid)
const char * dsgettext (const char *domainname, const char *msgid)
const char * sngettext (const char *singular, const char *plural, int n)
const char * dsngettext (const char *domainname, const char *singular, const char *plural, int n)

Function Documentation

const char* dsgettext ( const char *  domainname,
const char *  msgid 
)

Definition at line 40 of file gettext.cpp.

Referenced by t_string_base::str().

Here is the caller graph for this function:

const char* dsngettext ( const char *  domainname,
const char *  singular,
const char *  plural,
int  n 
)

Definition at line 67 of file gettext.cpp.

char const* egettext ( const char *   ) 

How to use gettext for wesnoth source files:

  1. include this header file in the .cpp file
  2. make sure, that the source file is listed in the respective POTFILES.in for the textdomain, in the case of wesnoth-lib it is this file: po/wesnoth-lib/POTFILES.in
  3. add the following include to set the correct textdomain, in this example wesnoth-lib (not required for the domain 'wesnoth', required for all other textdomains).

    #define GETTEXT_DOMAIN "wesnoth-lib"

This should be all that is required to have your strings that are marked translatable in the po files and translated ingame. So you at least have to mark the strings translatable, too. ;)

Definition at line 22 of file gettext.cpp.

Referenced by attack_type::attack_type().

Here is the caller graph for this function:

const char* sgettext ( const char *  msgid  ) 

Definition at line 27 of file gettext.cpp.

Referenced by events::menu_handler::ai_formula(), unit_type::alignment_description(), and events::menu_handler::user_command().

Here is the caller graph for this function:

const char* sngettext ( const char *  singular,
const char *  plural,
int  n 
)

Definition at line 54 of file gettext.cpp.

Referenced by events::menu_handler::recruit().

Here is the caller graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:04:30 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs