Add localization support in client

This commit is contained in:
Guillaume Meunier
2024-06-08 21:24:06 +02:00
parent 2483cb458f
commit 55ccb0d34b
17 changed files with 259 additions and 69 deletions
+15
View File
@@ -29,6 +29,9 @@
#include "vk/vk_allocator.h"
#include "xr/xr.h"
#include <atomic>
#include <boost/locale/generator.hpp>
#include <boost/locale/gnu_gettext.hpp>
#include <boost/locale/message.hpp>
#include <chrono>
#include <filesystem>
#include <glm/glm.hpp>
@@ -43,6 +46,10 @@
#include <openxr/openxr_platform.h>
#include <openxr/openxr_reflection.h>
#define _(x) boost::locale::gettext(x)
#define _F(x) fmt::runtime(boost::locale::gettext(x))
#define _S(x) boost::locale::gettext(x).c_str()
class scene;
struct application_info
@@ -137,6 +144,9 @@ class application : public singleton<application>
std::optional<configuration> config;
boost::locale::generator gen;
boost::locale::gnu_gettext::messages_info messages_info;
void loop();
std::mutex debug_report_mutex;
@@ -414,4 +424,9 @@ public:
assert(instance().config);
return *instance().config;
}
static boost::locale::gnu_gettext::messages_info & get_messages_info()
{
return instance().messages_info;
}
};