Skip to content
API Documentation
BastionGuard™
i18n.cpp
Go to the documentation of this file.
1#include "i18n.hpp"
2
3#include <libintl.h>
4#include <locale.h>
5#include <string>
6
7#ifndef LOCALEDIR
8#define LOCALEDIR "/usr/share/locale"
9#endif
10
11void init_i18n() {
12 setlocale(LC_ALL, "");
13 bindtextdomain("bastionguard-recovery-data", LOCALEDIR);
14 bind_textdomain_codeset("bastionguard-recovery-data", "UTF-8");
15 textdomain("bastionguard-recovery-data");
16}
17
18const char* tr(const char* msgid) {
19 return gettext(msgid);
20}
21
22std::string trs(const char* msgid) {
23 return gettext(msgid);
24}
#define LOCALEDIR
const char * tr(const char *msgid)
Definition i18n.cpp:18
std::string trs(const char *msgid)
Definition i18n.cpp:22
void init_i18n()
Definition i18n.cpp:11