prepare for translations

This commit is contained in:
tildearrow 2024-05-26 03:57:26 -05:00
parent 905d8cae75
commit 34c176a799
10 changed files with 203 additions and 0 deletions

View file

@ -658,6 +658,11 @@ void FurnaceGUI::drawDebug() {
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Locale Test")) {
ImGui::TextUnformatted(_("This is a language test."));
ImGui::TextUnformatted(_("This is another language test."));
ImGui::TreePop();
}
if (ImGui::TreeNode("Osc Render Test")) {
ImGui::InputInt("Length",&oscDebugLen);
ImGui::InputInt("Height",&oscDebugHeight);

View file

@ -489,6 +489,27 @@ int main(int argc, char** argv) {
zsmOutName="";
cmdOutName="";
#ifdef HAVE_LOCALE
const char* localeRet=NULL;
if ((localeRet=setlocale(LC_ALL,""))==NULL) {
logE("could not set locale!");
} else {
logV("locale: %s",localeRet);
}
if ((localeRet=bindtextdomain("furnace","locale"))==NULL) {
logE("could not bind text domain!");
} else {
logV("text domain 1: %s",localeRet);
}
if ((localeRet=textdomain("furnace"))==NULL) {
logE("could not text domain!");
} else {
logV("text domain 2: %s",localeRet);
}
logV(_("this is a test!"));
#endif
initParams();
// parse arguments

View file

@ -42,6 +42,13 @@ typedef std::string String;
#define MAX(a,b) (((a)>(b))?(a):(b))
#define CLAMP(x,xMin,xMax) (MIN(MAX((x),(xMin)),(xMax)))
#ifdef HAVE_LOCALE
#include <libintl.h>
#define _(_str) gettext(_str)
#else
#define _(_str) _str
#endif
typedef std::wstring WString;
enum TAParamResult {