diff --git a/source/src/Makefile b/source/src/Makefile index 298bde64..d97c151b 100644 --- a/source/src/Makefile +++ b/source/src/Makefile @@ -18,6 +18,7 @@ CLIENT_OBJS= \ docs.o \ editing.o \ entities.o \ + i18n.o \ log.o \ main.o \ menus.o \ diff --git a/source/src/i18n.cpp b/source/src/i18n.cpp index 2b7fae16..8ac45e2b 100644 --- a/source/src/i18n.cpp +++ b/source/src/i18n.cpp @@ -2,6 +2,7 @@ #include "pch.h" #include "cube.h" +#include 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 -} \ No newline at end of file +} diff --git a/source/src/i18n.h b/source/src/i18n.h index 2a8aa380..31370303 100644 --- a/source/src/i18n.h +++ b/source/src/i18n.h @@ -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 diff --git a/source/src/tools.h b/source/src/tools.h index 7ed5cf69..70bcc5f7 100644 --- a/source/src/tools.h +++ b/source/src/tools.h @@ -610,6 +610,7 @@ template 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);