|
HikoGUI
A low latency retained GUI
|
#include <ttauri/l10n.hpp>
Public Member Functions | |
| constexpr | l10n () noexcept |
| Construct an empty message. | |
| l10n (l10n &&) noexcept=default | |
| l10n & | operator= (l10n &&) noexcept=default |
| l10n (l10n const &other) noexcept | |
| l10n & | operator= (l10n const &other) noexcept |
| operator bool () const noexcept | |
| Check if the message is in use. | |
| template<typename... Args> | |
| l10n (std::string_view msg_id, Args const &...args) noexcept | |
| Construct a localizable message. | |
| std::string | operator() (std::vector< language * > const &languages=language::preferred_languages()) const noexcept |
| Translate and format the message. | |
| std::string | operator() (std::locale const &loc, std::vector< language * > const &languages=language::preferred_languages()) const noexcept |
| Translate and format the message. | |
Friends | |
| bool | operator== (l10n const &lhs, l10n const &rhs) noexcept |
| Compare two localizable messages. | |
A localizable message.
The translation and formatting of the message is delayed until displaying it to the user. This allows the user to change the language while the application is running.
|
inlineconstexprnoexcept |
Construct an empty message.
|
inlinenoexcept |
Construct a localizable message.
It is recommended to use the parentheses form of the constructor so that it will look like a function which is recognized by the gettext tool.
| msg_id | A English string that is looked up in the translation database or, when not found, as-is. The msg_id may contain placeholders using the std::format format. Plurality is based on the first std::integral arguments. |
| args | Arguments passed to std::format. The arguments are copied into the l10n object and used when formatting the translated string. |
|
inlineexplicitnoexcept |
Check if the message is in use.
|
inlinenoexcept |
Translate and format the message.
Find the translation of the message, then format it.
| locale | The locale to use when formatting the message. |
| languages | A list of languages to search for translations. |
|
inlinenoexcept |
Translate and format the message.
Find the translation of the message, then format it.
| languages | A list of languages to search for translations. |
Compare two localizable messages.
| lhs | A localizable message. |
| rhs | A localizable message. |