Immutable, cached translations of complete English message templates.
More...
#include <gmessageCatalog.h>
|
| std::string_view | translate (std::string_view english) const |
| | Returns a translated template, or the original view when no translation is available.
|
| template<typename... Args> |
| std::string | format (std::string_view message, Args &&... args) const |
| | Translate and format a complete template without logging headers or verbosity filtering. Supports %1 through %99 and literal %%; inserted parameter text is never interpreted as a template. Invalid or unused parameter positions throw std::invalid_argument, matching GLogger formatting.
|
| const std::string & | language () const |
| | Normalized requested language tag; a missing catalog still falls back to English per message.
|
|
| static std::shared_ptr< const GMessageCatalog > | load (const GOptions *options=nullptr) |
| | Resolve language and catalog paths from options/environment and reuse the cached catalog.
|
| static std::vector< std::filesystem::path > | searchDirectories (const GOptions *options=nullptr) |
| | Catalog search paths shared by logging and GUI translation startup.
|
Catalogs use schema 1 and an English-template-to-translation mapping. Invalid files are ignored with a diagnostic; missing messages retain their English text. Loading never changes the process locale.
Definition at line 22 of file gmessageCatalog.h.
◆ format()
template<typename... Args>
| std::string GMessageCatalog::format |
( |
std::string_view | message, |
|
|
Args &&... | args ) const |
|
inlinenodiscard |
◆ language()
| const std::string & GMessageCatalog::language |
( |
| ) |
const |
|
inlinenodiscard |
◆ load()
- Parameters
-
| options | Optional configuration with language and plugin_path scalar options. |
Definition at line 215 of file gmessageCatalog.cc.
◆ searchDirectories()
| std::vector< std::filesystem::path > GMessageCatalog::searchDirectories |
( |
const GOptions * | options = nullptr | ) |
|
|
staticnodiscard |
◆ translate()
| std::string_view GMessageCatalog::translate |
( |
std::string_view | english | ) |
const |
|
nodiscard |
The documentation for this class was generated from the following files: