|
HikoGUI
A low latency retained GUI
|
#include <hikogui/l10n/translate.hpp>
Public Member Functions | |
| constexpr | translate () noexcept |
| Construct an empty message. | |
| constexpr | translate (translate &&other) noexcept |
| constexpr translate & | operator= (translate &&other) noexcept |
| constexpr | translate (translate const &other) noexcept |
| constexpr translate & | operator= (translate const &other) noexcept |
| constexpr bool | empty () const noexcept |
| constexpr | operator bool () const noexcept |
| Check if the message is in use. | |
| constexpr | translate (std::string_view msg_id) noexcept |
| Construct a localizable message. | |
| template<typename FirstArg , typename... Args> | |
| translate (std::string_view msg_id, FirstArg const &first_arg, Args const &...args) noexcept | |
| Construct a localizable message. | |
| text | operator() (std::vector< language_tag > const &languages=os_settings::language_tags()) const noexcept |
| Translate and format the message. | |
| text | operator() (std::locale const &loc, std::vector< language_tag > const &languages=os_settings::language_tags()) const noexcept |
| Translate and format the message. | |
Friends | |
| constexpr friend bool | operator== (translate const &lhs, translate 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.
|
inlineconstexprnoexcept |
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. |
|
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. |
| first_arg | The first argument passed to std::format(). |
| args | Arguments passed to std::format(). |
Check if the message is in use.
|
inlinenoexcept |
Translate and format the message.
Find the translation of the message, then format it.
| loc | 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. |