HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
translation.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
7#include "language.hpp"
8#include "../formula/formula.hpp"
9#include "../hash.hpp"
10#include <string>
11#include <string_view>
12#include <vector>
13#include <unordered_map>
14
15namespace tt {
16
17[[nodiscard]] std::u8string_view get_translation(
18 std::u8string_view msgid,
19 long long n=0,
20 std::vector<language*> const &languages=language::preferred_languages
21) noexcept;
22
23void add_translation(
24 std::u8string_view msgid,
25 language const &language,
26 std::vector<std::u8string> const &plural_forms
27) noexcept;
28
29void add_translation(
30 std::u8string_view msgid,
31 std::u8string const &language_tag,
32 std::vector<std::u8string> const &plural_forms
33) noexcept;
34
35struct po_translations;
36void add_translation(po_translations const &translations, language const &language) noexcept;
37
38}