Manager class for dictionaries, you give it a bunch of directories with .po files and it will then automatically load the right file on demand depending on which language was set.
More...
#include <dictionary_manager.hpp>
Manager class for dictionaries, you give it a bunch of directories with .po files and it will then automatically load the right file on demand depending on which language was set.
◆ Dictionaries
◆ SearchPath
◆ DictionaryManager() [1/2]
tinygettext::DictionaryManager::DictionaryManager |
( |
const std::string & |
charset_ = "UTF-8" | ) |
|
◆ ~DictionaryManager()
tinygettext::DictionaryManager::~DictionaryManager |
( |
| ) |
|
◆ DictionaryManager() [2/2]
◆ add_directory()
void tinygettext::DictionaryManager::add_directory |
( |
const std::string & |
pathname, |
|
|
bool |
precedence = false |
|
) |
| |
Add a directory to the search path for dictionaries, earlier added directories have higher priority then later added ones.
Set precedence
to true to invert this for a single addition.
◆ clear_cache()
void tinygettext::DictionaryManager::clear_cache |
( |
| ) |
|
|
private |
◆ convertFilename2Language()
std::string tinygettext::DictionaryManager::convertFilename2Language |
( |
const std::string & |
s_in | ) |
const |
This function converts a .po filename (e.g.
zh_TW.po) into a language specification (zh_TW). On case insensitive file systems (think windows) the filename and therefore the country specification is lower case (zh_tw). It Converts the lower case characters of the country back to upper case, otherwise tinygettext does not identify the country correctly.
◆ get_dictionary() [1/2]
Dictionary & tinygettext::DictionaryManager::get_dictionary |
( |
| ) |
|
Return the currently active dictionary, if none is set, an empty dictionary is returned.
◆ get_dictionary() [2/2]
Get dictionary for language.
◆ get_language()
Language tinygettext::DictionaryManager::get_language |
( |
| ) |
const |
returns the (normalized) country code of the currently used language
◆ get_languages()
std::set< Language > tinygettext::DictionaryManager::get_languages |
( |
| ) |
|
Return a set of the available languages in their country code.
◆ get_use_fuzzy()
bool tinygettext::DictionaryManager::get_use_fuzzy |
( |
| ) |
const |
◆ operator=()
◆ remove_directory()
void tinygettext::DictionaryManager::remove_directory |
( |
const std::string & |
pathname | ) |
|
Remove a directory from the search path.
◆ set_charset()
void tinygettext::DictionaryManager::set_charset |
( |
const std::string & |
charset | ) |
|
Set a charset that will be set on the returned dictionaries.
◆ set_filesystem()
void tinygettext::DictionaryManager::set_filesystem |
( |
std::unique_ptr< FileSystem > |
filesystem | ) |
|
◆ set_language()
void tinygettext::DictionaryManager::set_language |
( |
const Language & |
language | ) |
|
Set a language based on a four? letter country code.
◆ set_use_fuzzy()
void tinygettext::DictionaryManager::set_use_fuzzy |
( |
bool |
t | ) |
|
◆ charset
std::string tinygettext::DictionaryManager::charset |
|
private |
◆ current_dict
Dictionary* tinygettext::DictionaryManager::current_dict |
|
private |
◆ current_language
Language tinygettext::DictionaryManager::current_language |
|
private |
◆ dictionaries
◆ empty_dict
Dictionary tinygettext::DictionaryManager::empty_dict |
|
private |
◆ filesystem
std::unique_ptr<FileSystem> tinygettext::DictionaryManager::filesystem |
|
private |
◆ search_path
SearchPath tinygettext::DictionaryManager::search_path |
|
private |
◆ use_fuzzy
bool tinygettext::DictionaryManager::use_fuzzy |
|
private |
The documentation for this class was generated from the following files:
- /home/docker/jenkins/workspace/technical-docs/source/third_party/tinygettext/include/tinygettext/dictionary_manager.hpp
- /home/docker/jenkins/workspace/technical-docs/source/third_party/tinygettext/src/dictionary_manager.cpp