#include <gLocalization.h>
Database-driven localization system for multi-language text translation. Expects database table with "Key" column and language columns.
◆ gLocalization()
| gLocalization::gLocalization |
( |
| ) |
|
◆ ~gLocalization()
| virtual gLocalization::~gLocalization |
( |
| ) |
|
|
virtual |
◆ getAvailableLanguages()
| const std::vector< std::string > & gLocalization::getAvailableLanguages |
( |
| ) |
const |
- Returns
- Available language columns (excluding "Key")
◆ getColumnData()
| std::string gLocalization::getColumnData |
( |
const std::string & |
columnname | ) |
|
◆ getColumnList()
| const std::vector< std::string > & gLocalization::getColumnList |
( |
| ) |
const |
◆ getCurrentLanguage()
| std::string gLocalization::getCurrentLanguage |
( |
| ) |
const |
- Returns
- Current language column name, empty if invalid
◆ getLangId()
| int gLocalization::getLangId |
( |
| ) |
const |
◆ getTableInfo()
| std::string gLocalization::getTableInfo |
( |
| ) |
|
◆ loadDatabase()
| bool gLocalization::loadDatabase |
( |
const std::string & |
database, |
|
|
const std::string & |
tableName = "WORDS" |
|
) |
| |
Load localization database and parse available language columns
- Parameters
-
| database | Database file path |
| tableName | Table containing translations (default: "WORDS") |
- Returns
- Is the database loaded or not
◆ localizeWord()
| std::string gLocalization::localizeWord |
( |
const std::string & |
word | ) |
|
Translate word using current language setting
- Parameters
-
| word | Key to look up in database |
- Returns
- Translated text, or original word if not found
◆ setCurrentLanguage()
| void gLocalization::setCurrentLanguage |
( |
int |
languageId | ) |
|
Set active language by column index (0-based, excluding "Key" column)
- Parameters
-
| languageId | Language index (bounds-checked) |
The documentation for this class was generated from the following file: