xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
Loading...
Searching...
No Matches
xentara::workbench::i18n::Context< kContextString > Class Template Reference

A context that uses a certain context string. More...

#include <xentara/workbench/i18n/Context.hpp>

Public Types

template<utils::tparam::String kText>
using Translate = i18n::Translate< kContextString, kText >
 A translated string that can be used as a template parameter.
 

Static Public Member Functions

static auto translate (std::string_view text) -> ui::String
 Function to translate a string to the system language.
 
template<typename... Arguments>
static auto format (std::string_view format, Arguments &&...arguments) -> ui::String
 Function to format a string and translate it to the system language.
 
template<typename OutputIterator , typename... Arguments>
static auto format_to (OutputIterator output, std::string_view format, Arguments &&...arguments) -> OutputIterator
 Function to format a string to an output sequence and translate it to the system language.
 

Detailed Description

template<utils::tparam::String kContextString>
class xentara::workbench::i18n::Context< kContextString >

A context that uses a certain context string.

Member Typedef Documentation

◆ Translate

template<utils::tparam::String kContextString>
template<utils::tparam::String kText>
using xentara::workbench::i18n::Context< kContextString >::Translate = i18n::Translate<kContextString, kText>

A translated string that can be used as a template parameter.

Parameters
kTextThe text to translate

Member Function Documentation

◆ format()

template<utils::tparam::String kContextString>
template<typename... Arguments>
static auto xentara::workbench::i18n::Context< kContextString >::format ( std::string_view  format,
Arguments &&...  arguments 
) -> ui::String
static

Function to format a string and translate it to the system language.

Parameters
formatThe format string (will be translated)
argumentsThe format arguments (will not be translated)
Returns
The formatted string

◆ format_to()

template<utils::tparam::String kContextString>
template<typename OutputIterator , typename... Arguments>
static auto xentara::workbench::i18n::Context< kContextString >::format_to ( OutputIterator  output,
std::string_view  format,
Arguments &&...  arguments 
) -> OutputIterator
static

Function to format a string to an output sequence and translate it to the system language.

Parameters
outputThe iterator that the translated text should be written to.
formatThe format string (will be translated)
argumentsThe format arguments (will not be translated)
Returns
An iterator past the end of the output range.

◆ translate()

template<utils::tparam::String kContextString>
static auto xentara::workbench::i18n::Context< kContextString >::translate ( std::string_view  text) -> ui::String
static

Function to translate a string to the system language.

Parameters
textThe text to translate
Returns
The translated string