Add header for i18n macros

This commit is contained in:
Patrick Nicolas
2024-11-26 23:59:35 +01:00
parent 5f39447d38
commit 03bf98fe20
6 changed files with 31 additions and 9 deletions
-5
View File
@@ -33,7 +33,6 @@
#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>
@@ -48,10 +47,6 @@
#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;
#ifdef __ANDROID__
+1
View File
@@ -29,6 +29,7 @@
#include "render/scene_data.h"
#include "render/scene_renderer.h"
#include "stream.h"
#include "utils/i18n.h"
#include "utils/overloaded.h"
#include "wivrn_client.h"
#include "wivrn_discover.h"
+1
View File
@@ -29,6 +29,7 @@
#include "implot.h"
#include "lobby.h"
#include "stream.h"
#include "utils/i18n.h"
#include "version.h"
#include <cassert>
#include <chrono>
+1
View File
@@ -24,6 +24,7 @@
#include "application.h"
#include "imgui_internal.h"
#include "implot.h"
#include "utils/i18n.h"
#include "utils/ranges.h"
#include <cmath>
#include <limits>
+24
View File
@@ -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()
+4 -4
View File
@@ -21,9 +21,9 @@
#include "hardware.h"
#include "secrets.h"
#include "spdlog/common.h"
#include "utils/i18n.h"
#include "wivrn_packets.h"
#include <arpa/inet.h>
#include <boost/locale/gnu_gettext.hpp>
#include <ifaddrs.h>
#include <linux/ipv6.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)
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:
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
@@ -167,7 +167,7 @@ void wivrn_session::handshake(T address, bool tcp_only, crypto::key & headset_ke
}
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 (stream)