i18n compile fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4630 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -18,6 +18,7 @@ CLIENT_OBJS= \
|
||||
docs.o \
|
||||
editing.o \
|
||||
entities.o \
|
||||
i18n.o \
|
||||
log.o \
|
||||
main.o \
|
||||
menus.o \
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "pch.h"
|
||||
#include "cube.h"
|
||||
#include <locale.h>
|
||||
|
||||
i18nmanager::i18nmanager(const char *domain, const char *basepath) : domain(domain), basepath(basepath)
|
||||
{
|
||||
@@ -12,4 +13,4 @@ i18nmanager::i18nmanager(const char *domain, const char *basepath) : domain(doma
|
||||
printf("current locale: %s\n", locale);
|
||||
|
||||
printf(_("hello world\n")); // test output
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@
|
||||
// localization manager
|
||||
struct i18nmanager
|
||||
{
|
||||
const char *basepath;
|
||||
const char *domain;
|
||||
const char *basepath;
|
||||
char *locale;
|
||||
|
||||
i18nmanager(const char *domain, const char *basepath); // initialize locale system
|
||||
|
||||
+3
-1
@@ -610,6 +610,7 @@ template <class T, int SIZE> struct ringbuf
|
||||
#define enumeratek(ht,k,e,b) loopi((ht).size) for((ht).enumc = (ht).table[i]; (ht).enumc;) { k &e = (ht).enumc->key; (ht).enumc = (ht).enumc->next; b; }
|
||||
#define enumerate(ht,t,e,b) loopi((ht).size) for((ht).enumc = (ht).table[i]; (ht).enumc;) { t &e = (ht).enumc->data; (ht).enumc = (ht).enumc->next; b; }
|
||||
|
||||
#ifndef STANDALONE
|
||||
// ease time measurement
|
||||
struct stopwatch
|
||||
{
|
||||
@@ -631,6 +632,7 @@ struct stopwatch
|
||||
return time;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
inline char *newstring(size_t l) { return new char[l+1]; }
|
||||
inline char *newstring(const char *s, size_t l) { return s_strncpy(newstring(l), s, l+1); }
|
||||
@@ -638,7 +640,7 @@ inline char *newstring(const char *s) { return newstring(s, strlen(s))
|
||||
inline char *newstringbuf() { return newstring(_MAXDEFSTR-1); }
|
||||
inline char *newstringbuf(const char *s) { return newstring(s, _MAXDEFSTR-1); }
|
||||
|
||||
inline char *_gettext(const char *msgid)
|
||||
inline const char *_gettext(const char *msgid)
|
||||
{
|
||||
if(msgid && msgid[0] != '\0')
|
||||
return gettext(msgid);
|
||||
|
||||
Reference in New Issue
Block a user