From c17c4ca2bf88935f7a66994e95f1946c5e69cef7 Mon Sep 17 00:00:00 2001
From: Fabrice Bellet <fabrice@bellet.info>
Date: Wed, 2 Dec 2020 11:03:37 +0100
Subject: [PATCH] fgviewer: prevent an assert on uninitialized locale
---
src/Viewer/fgviewer.cxx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/Viewer/fgviewer.cxx b/src/Viewer/fgviewer.cxx
index 40a076622..43685488f 100644
--- a/src/Viewer/fgviewer.cxx
+++ b/src/Viewer/fgviewer.cxx
@@ -38,6 +38,7 @@
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
+#include <Main/locale.hxx>
#include <Main/options.hxx>
#include <Main/fg_init.hxx>
@@ -225,6 +226,9 @@ fgviewerMain(int argc, char** argv)
options->setPropertyNode(globals->get_props());
options->setPluginStringData("SimGear::PREVIEW", "ON");
+ // otherwise fgSplashProgress will assert
+ globals->get_locale()->selectLanguage({});
+
// Now init the renderer, as we've got all the options, globals etc.
fgrenderer->init();
--
2.26.2