]> git.mxchange.org Git - flightgear.git/blob - src/GUI/menubar.cxx
Move viewer-related sources to separate folder.
[flightgear.git] / src / GUI / menubar.cxx
1 #ifdef HAVE_CONFIG_H
2 #  include <config.h>
3 #endif
4
5
6 #include "menubar.hxx"
7 #include <Main/locale.hxx>
8 #include <Main/globals.hxx>
9 #include <simgear/math/SGMath.hxx>
10
11 FGMenuBar::FGMenuBar()
12 {
13     // load locale's menu resources (default and current language)
14     globals->get_locale()->loadResource("menu");
15 }
16
17 FGMenuBar::~FGMenuBar ()
18 {
19 }
20
21 const char*
22 FGMenuBar::getLocalizedLabel(SGPropertyNode* node)
23 {
24     const char* name = node->getStringValue("name", 0);
25
26     const char* translated = globals->get_locale()->getLocalizedString(name, "menu");
27     if (translated)
28         return translated;
29
30     // return default
31     return node->getStringValue("label");
32 }
33
34 // end of menubar.cxx