From 8722af0eb80b83666903cba2086746ad943b52d2 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 1 Oct 2002 18:38:34 +0000 Subject: [PATCH] Read menu titles indirectly from specified property names so we can support translations. --- src/GUI/gui.cxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 8dd66e826..0a1a071ce 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -117,14 +117,17 @@ void initMenu() SGPropertyNode *sep = option[i]->getNode("seperator"); int pos = option.size()-i-1; - if (sep) + if (sep) { Menu[h].submenu[pos] = strdup("----------"); - - else if (call && strcmp(call->getStringValue(), "")) - Menu[h].submenu[pos] = strdup(name->getStringValue()); - - else + } else if (call && strcmp(call->getStringValue(), "")) { + cout << name->getStringValue() << endl; + string text = fgGetString( name->getStringValue(), + "/strings/null" ); + Menu[h].submenu[pos] + = strdup(text.c_str()); + } else { Menu[h].submenu[pos] = strdup("not specified"); + } Menu[h].cb[pos] = NULL; for (unsigned int j=0; __fg_gui_fn[j].fn; j++) @@ -137,8 +140,11 @@ void initMenu() } SGPropertyNode *name = submenu[h]->getNode("name"); + cout << name->getStringValue() << endl; + string text = fgGetString( name->getStringValue(), + "/strings/null" ); - Menu[h].name = strdup(name->getStringValue()); + Menu[h].name = strdup(text.c_str()); mainMenuBar->add_submenu(Menu[h].name, Menu[h].submenu, Menu[h].cb); }