Add header for i18n macros
This commit is contained in:
@@ -33,7 +33,6 @@
|
|||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <boost/locale/generator.hpp>
|
#include <boost/locale/generator.hpp>
|
||||||
#include <boost/locale/gnu_gettext.hpp>
|
#include <boost/locale/gnu_gettext.hpp>
|
||||||
#include <boost/locale/message.hpp>
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
@@ -48,10 +47,6 @@
|
|||||||
#include <openxr/openxr_platform.h>
|
#include <openxr/openxr_platform.h>
|
||||||
#include <openxr/openxr_reflection.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;
|
class scene;
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "render/scene_data.h"
|
#include "render/scene_data.h"
|
||||||
#include "render/scene_renderer.h"
|
#include "render/scene_renderer.h"
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
|
#include "utils/i18n.h"
|
||||||
#include "utils/overloaded.h"
|
#include "utils/overloaded.h"
|
||||||
#include "wivrn_client.h"
|
#include "wivrn_client.h"
|
||||||
#include "wivrn_discover.h"
|
#include "wivrn_discover.h"
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "implot.h"
|
#include "implot.h"
|
||||||
#include "lobby.h"
|
#include "lobby.h"
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
|
#include "utils/i18n.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
#include "implot.h"
|
#include "implot.h"
|
||||||
|
#include "utils/i18n.h"
|
||||||
#include "utils/ranges.h"
|
#include "utils/ranges.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* WiVRn VR streaming
|
||||||
|
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||||
|
* Copyright (C) 2024 Patrick Nicolas <patricknicolas@laposte.net>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <boost/locale/gnu_gettext.hpp>
|
||||||
|
|
||||||
|
#define _(x) boost::locale::gettext(x)
|
||||||
|
#define _F(x) fmt::runtime(boost::locale::gettext(x))
|
||||||
|
#define _S(x) boost::locale::gettext(x).c_str()
|
||||||
@@ -21,9 +21,9 @@
|
|||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
#include "secrets.h"
|
#include "secrets.h"
|
||||||
#include "spdlog/common.h"
|
#include "spdlog/common.h"
|
||||||
|
#include "utils/i18n.h"
|
||||||
#include "wivrn_packets.h"
|
#include "wivrn_packets.h"
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <boost/locale/gnu_gettext.hpp>
|
|
||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
#include <linux/ipv6.h>
|
#include <linux/ipv6.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
@@ -93,7 +93,7 @@ void wivrn_session::handshake(T address, bool tcp_only, crypto::key & headset_ke
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (std::chrono::steady_clock::now() >= timeout_abs)
|
if (std::chrono::steady_clock::now() >= timeout_abs)
|
||||||
throw std::runtime_error(boost::locale::gettext("Timeout"));
|
throw std::runtime_error(_("Timeout"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ void wivrn_session::handshake(T address, bool tcp_only, crypto::key & headset_ke
|
|||||||
|
|
||||||
case to_headset::crypto_handshake::crypto_state::enroll_disabled:
|
case to_headset::crypto_handshake::crypto_state::enroll_disabled:
|
||||||
spdlog::info("Pairing is disabled on server");
|
spdlog::info("Pairing is disabled on server");
|
||||||
throw std::runtime_error(boost::locale::gettext("Pairing is disabled on server"));
|
throw std::runtime_error(_("Pairing is disabled on server"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// may be on control socket if forced TCP
|
// may be on control socket if forced TCP
|
||||||
@@ -167,7 +167,7 @@ void wivrn_session::handshake(T address, bool tcp_only, crypto::key & headset_ke
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (std::chrono::steady_clock::now() >= timeout)
|
if (std::chrono::steady_clock::now() >= timeout)
|
||||||
throw std::runtime_error(boost::locale::gettext("Timeout"));
|
throw std::runtime_error(_("Timeout"));
|
||||||
|
|
||||||
// If using stream socket, the handshake might be lost
|
// If using stream socket, the handshake might be lost
|
||||||
if (stream)
|
if (stream)
|
||||||
|
|||||||
Reference in New Issue
Block a user