]> git.mxchange.org Git - flightgear.git/commitdiff
Better fallback for missing menu and splash translations.
authorThomas Geymayer <tomgey@gmail.com>
Wed, 30 Jul 2014 21:53:16 +0000 (23:53 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Wed, 30 Jul 2014 21:53:16 +0000 (23:53 +0200)
src/GUI/menubar.cxx
src/Viewer/splash.cxx

index 444795fd592d938fec73b72105a9bfddc1de5f12..40191e37b06034e831a7699af45981f7ce208831 100644 (file)
@@ -26,8 +26,8 @@ FGMenuBar::getLocalizedLabel(SGPropertyNode* node)
     if (translated)
         return translated;
 
-    // return default
-    return node->getStringValue("label");
+    // return default with fallback to name
+    return node->getStringValue("label", name);
 }
 
 // end of menubar.cxx
index 5452aac641f11ff8969b04c6ab3511b0f8296730..03995c44f9a2086a2ea1a42bb4b1ebb1771e6041 100644 (file)
@@ -395,12 +395,14 @@ void fgSplashProgress( const char *identifier ) {
 
   fgSetString("/sim/startup/splash-progress-spinner", spin_status);
 
-  const char* text = "";
+  std::string text;
   if (identifier[0] != 0)
   {
-      std::string id = std::string("splash/") + identifier;
-      text = globals->get_locale()->getLocalizedString(id.c_str(),
-                                                       "sys", "<incomplete language resource>");
+    std::string id = std::string("splash/") + identifier;
+    text = globals->get_locale()->getLocalizedString(id.c_str(), "sys", "");
+
+    if( text.empty() )
+      text = "<incomplete language resource>: " + id;
   }
     
     if (!strcmp(identifier,"downloading-scenery")) {
@@ -414,9 +416,8 @@ void fgSplashProgress( const char *identifier ) {
         return;
     }
     
-    if (!strcmp(fgGetString("/sim/startup/splash-progress-text"), text)) {
-        return;
-    }
+    if( fgGetString("/sim/startup/splash-progress-text") == text )
+      return;
     
     SG_LOG( SG_VIEW, SG_INFO, "Splash screen progress " << identifier );
     fgSetString("/sim/startup/splash-progress-text", text);