]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/menubar.cxx
Expose more runway methods to Nasal
[flightgear.git] / src / GUI / menubar.cxx
index 4295f808b988236bcb41c94546eedb45aae293eb..444795fd592d938fec73b72105a9bfddc1de5f12 100644 (file)
@@ -4,9 +4,30 @@
 
 
 #include "menubar.hxx"
+#include <Main/locale.hxx>
+#include <Main/globals.hxx>
+
+FGMenuBar::FGMenuBar()
+{
+    // load locale's menu resources (default and current language)
+    globals->get_locale()->loadResource("menu");
+}
 
 FGMenuBar::~FGMenuBar ()
 {
 }
 
+const char*
+FGMenuBar::getLocalizedLabel(SGPropertyNode* node)
+{
+    const char* name = node->getStringValue("name", 0);
+
+    const char* translated = globals->get_locale()->getLocalizedString(name, "menu");
+    if (translated)
+        return translated;
+
+    // return default
+    return node->getStringValue("label");
+}
+
 // end of menubar.cxx