HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
l10n.hpp
1// Copyright Take Vos 2020.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7namespace tt {
8
12class l10n {
13public:
14 l10n() noexcept : msgid() {}
15 l10n(l10n const &) noexcept = default;
16 l10n(l10n &&) noexcept = default;
17 l10n &operator=(l10n const &) noexcept = default;
18 l10n &operator=(l10n &&) noexcept = default;
19
20 [[nodiscard]] operator bool() const noexcept
21 {
22 return !msgid.empty();
23 }
24
25 l10n(std::u8string_view msgid) noexcept : msgid(msgid) {}
26 l10n(std::string_view msgid) noexcept
27 {
28 this->msgid = std::u8string(reinterpret_cast<char8_t const *>(msgid.data()), msgid.size());
29 }
30
31private:
32 std::u8string msgid;
33
34 friend class label;
35};
36
37}
A localizable string.
Definition l10n.hpp:12
A localized text + icon label.
Definition label.hpp:76
T empty(T... args)