neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i18n.hpp
Go to the documentation of this file.
1
// i18n.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <
neogfx/neogfx.hpp
>
23
24
namespace
neogfx
25
{
26
using
neolib::i_string
;
27
using
neolib::string
;
28
29
class
translation_context
30
{
31
public
:
32
translation_context
(
string
const
& aContext);
33
~translation_context
();
34
public
:
35
static
string
const
&
context
();
36
private
:
37
static
std::vector<string>& context_stack();
38
};
39
40
class
translatable_string
:
public
string
41
{
42
public
:
43
translatable_string
(
i_string
const
& aTranslatableString,
i_string
const
& aContext);
44
public
:
46
translatable_string
&
operator()
(std::int64_t aPlurality);
47
private
:
48
string
iTranslatableString;
49
string
iContext;
50
};
51
52
translatable_string
translate
(
string
const
& aTranslatableString);
53
translatable_string
translate
(
string
const
& aTranslatableString,
string
const
& aContext);
54
translatable_string
operator
""
_t(
const
char
* aTranslatableString, std::size_t aStringLength);
55
translatable_string
operator
""
_t(
const
char8_t
* aTranslatableString, std::size_t aStringLength);
56
}
57
58
using
neogfx::operator
""
_t;
neogfx::translatable_string
Definition
i18n.hpp:41
neogfx::translatable_string::translatable_string
translatable_string(i_string const &aTranslatableString, i_string const &aContext)
neogfx::translatable_string::operator()
translatable_string & operator()(std::int64_t aPlurality)
neogfx::translation_context
Definition
i18n.hpp:30
neogfx::translation_context::context
static string const & context()
neogfx::translation_context::~translation_context
~translation_context()
neogfx::translation_context::translation_context
translation_context(string const &aContext)
neolib::i_string
Definition
i_string.hpp:49
neolib::string
Definition
string.hpp:52
neogfx
Definition
action.hpp:28
neogfx::translate
translatable_string translate(string const &aTranslatableString)
neogfx.hpp
include
neogfx
app
i18n.hpp
Generated by
1.9.8