moved vegettext() to string_utils,
since it is a wrapper around a higher-level function in there
This commit is contained in:
parent
a142fe13fc
commit
6490ba3b4f
6 changed files with 12 additions and 12 deletions
|
@ -1,7 +1,6 @@
|
|||
#include "global.hpp"
|
||||
|
||||
#include "gettext.hpp"
|
||||
#include "serialization/string_utils.hpp"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
|
@ -36,10 +35,3 @@ const char* dsgettext (const char * domainname, const char *msgid)
|
|||
}
|
||||
return msgval;
|
||||
}
|
||||
|
||||
std::string vgettext (const char *msgid, const utils::string_map& symbols)
|
||||
{
|
||||
const std::string orig(gettext(msgid));
|
||||
const std::string msg = utils::interpolate_variables_into_string(orig, &symbols);
|
||||
return msg;
|
||||
}
|
||||
|
|
|
@ -3,16 +3,12 @@
|
|||
|
||||
// gettext-related declarations
|
||||
|
||||
#include "config.hpp"
|
||||
#include "serialization/string_utils.hpp"
|
||||
|
||||
#include <libintl.h>
|
||||
#include <string>
|
||||
|
||||
const char* egettext(const char*);
|
||||
const char* sgettext(const char*);
|
||||
const char* dsgettext(const char * domainname, const char *msgid);
|
||||
std::string vgettext(const char*, const utils::string_map&);
|
||||
|
||||
#ifdef GETTEXT_DOMAIN
|
||||
# define _(String) dgettext(GETTEXT_DOMAIN,String)
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "random.hpp"
|
||||
#include "replay.hpp"
|
||||
#include "video.hpp"
|
||||
#include "serialization/string_utils.hpp"
|
||||
|
||||
#define LOG_NW LOG_STREAM(info, network)
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "filesystem.hpp"
|
||||
#include "preferences.hpp"
|
||||
#include "video.hpp"
|
||||
#include "serialization/string_utils.hpp"
|
||||
|
||||
namespace {
|
||||
const SDL_Rect null_rect = {0, 0, 0, 0};
|
||||
|
|
|
@ -554,3 +554,10 @@ utf8_string ucs2_string_to_utf8_string(const ucs2_string& src)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
std::string vgettext (const char *msgid, const utils::string_map& symbols)
|
||||
{
|
||||
const std::string orig(gettext(msgid));
|
||||
const std::string msg = utils::interpolate_variables_into_string(orig, &symbols);
|
||||
return msg;
|
||||
}
|
||||
|
|
|
@ -107,4 +107,7 @@ utf8_string ucs2_string_to_utf8_string(const ucs2_string& src);
|
|||
|
||||
}
|
||||
|
||||
// handy wrapper around interpolate_variables_into_string and gettext
|
||||
std::string vgettext(const char*, const utils::string_map&);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue