#include <TranslationManager.h>
|
| static void | load (const std::string &filepath) |
| | Loads a translation file. More...
|
| |
| static std::string | getTranslation (const std::string &key, const std::string &language, const std::list< std::string > &variables=std::list< std::string >()) |
| | Returns a translation from one of the global translation files. More...
|
| |
| static BaseLib::PVariable | getTranslations (const std::string &key, const std::list< std::string > &variables=std::list< std::string >()) |
| | Returns all available translations for a key as a Struct. More...
|
| |
§ TranslationManager()
| BaseLib::TranslationManager::TranslationManager |
( |
| ) |
|
|
delete |
§ getTranslation()
| std::string BaseLib::TranslationManager::getTranslation |
( |
const std::string & |
key, |
|
|
const std::string & |
language, |
|
|
const std::list< std::string > & |
variables = std::list<std::string>() |
|
) |
| |
|
static |
Returns a translation from one of the global translation files.
- Parameters
-
| key | The translation to lookup. |
| language | The language to return. |
| variables | Optional variables to replace in the translation string. |
- Returns
- The translation or an empty string if no translation was found.
§ getTranslations()
| BaseLib::PVariable BaseLib::TranslationManager::getTranslations |
( |
const std::string & |
key, |
|
|
const std::list< std::string > & |
variables = std::list<std::string>() |
|
) |
| |
|
static |
Returns all available translations for a key as a Struct.
- Parameters
-
| key | The translation to lookup for every language. |
| variables | Optional variables to replace in the translation string. |
- Returns
- The translations or an empty Struct if no translations were found.
§ load()
| void BaseLib::TranslationManager::load |
( |
const std::string & |
filepath | ) |
|
|
static |
Loads a translation file.
- Parameters
-
| filepath | The path to the translation directory containing language subdirectories which contain translation files in YAML format (i. e. "en-US/my-translation.yaml"). |
- Returns
- No return value.
The documentation for this class was generated from the following files: