MyGUI: MyGUI::LanguageManager Class Reference

MyGUI 3.4.3

Public Member Functions | Static Public Member Functions | Data Fields
MyGUI::LanguageManager Class Reference

`#include <MyGUI_LanguageManager.h>`

Inheritance diagram for MyGUI::LanguageManager:
[legend]

## Public Member Functions
| LanguageManager (const LanguageManager &)=delete
LanguageManager & | operator= (const LanguageManager &)=delete
| LanguageManager ()
void | initialise ()
void | shutdown ()
void | setCurrentLanguage (std::string_view _name)
const std::string & | getCurrentLanguage () const
VectorString | getLanguages () const
UString | replaceTags (const UString &_line)
UString | getTag (const UString &_tag) const
void | addUserTag (const UString &_tag, const UString &_replace)
void | clearUserTags ()
bool | loadUserTags (const std::string &_file)
Public Member Functions inherited from MyGUI::MemberObsolete< LanguageManager >
bool | load (const std::string &_file)

## Static Public Member Functions
static LanguageManager & | getInstance ()
static LanguageManager * | getInstancePtr ()
static std::string_view | getClassTypeName ()

## Data Fields
delegates::MultiDelegate< const std::string & > | eventChangeLanguage
delegates::Delegate< const UString &, UString & > | eventRequestTag

## Detailed Description

Definition at line 20 of file MyGUI_LanguageManager.h.

## Constructor & Destructor Documentation

## ◆ LanguageManager() [1/2]

MyGUI::LanguageManager::LanguageManager | ( | const LanguageManager & |  | ) |
| delete

## ◆ LanguageManager() [2/2]

MyGUI::LanguageManager::LanguageManager | ( |  | ) |

Definition at line 20 of file MyGUI_LanguageManager.cpp.

## Member Function Documentation

## ◆ addUserTag()

void MyGUI::LanguageManager::addUserTag | ( | const UString & | _tag,
|  | const UString & | _replace )

Add user tag

Definition at line 245 of file MyGUI_LanguageManager.cpp.

## ◆ clearUserTags()

void MyGUI::LanguageManager::clearUserTags | ( |  | ) |

Delete all user tags

Definition at line 250 of file MyGUI_LanguageManager.cpp.

## ◆ getClassTypeName()

std::string_view MyGUI::LanguageManager::getClassTypeName | ( |  | ) |
| static

Definition at line 18 of file MyGUI_LanguageManager.cpp.

## ◆ getCurrentLanguage()

const std::string & MyGUI::LanguageManager::getCurrentLanguage | ( |  | ) | const

Get current language

Definition at line 229 of file MyGUI_LanguageManager.cpp.

## ◆ getInstance()

LanguageManager & MyGUI::LanguageManager::getInstance | ( |  | ) |
| static

Definition at line 18 of file MyGUI_LanguageManager.cpp.

## ◆ getInstancePtr()

LanguageManager * MyGUI::LanguageManager::getInstancePtr | ( |  | ) |
| static

Definition at line 18 of file MyGUI_LanguageManager.cpp.

## ◆ getLanguages()

VectorString MyGUI::LanguageManager::getLanguages | ( |  | ) | const

Get all available languages

Definition at line 235 of file MyGUI_LanguageManager.cpp.

## ◆ getTag()

UString MyGUI::LanguageManager::getTag | ( | const UString & | _tag | ) | const

Get tag value

Definition at line 212 of file MyGUI_LanguageManager.cpp.

## ◆ initialise()

void MyGUI::LanguageManager::initialise | ( |  | ) |

Definition at line 26 of file MyGUI_LanguageManager.cpp.

## ◆ loadUserTags()

bool MyGUI::LanguageManager::loadUserTags | ( | const std::string & | _file | ) |

Load user tags

Definition at line 255 of file MyGUI_LanguageManager.cpp.

## ◆ operator=()

LanguageManager & MyGUI::LanguageManager::operator= | ( | const LanguageManager & |  | ) |
| delete

## ◆ replaceTags()

UString MyGUI::LanguageManager::replaceTags | ( | const UString & | _line | ) |

Replace all tags #{tagname} in _line with appropriate string dependent on current language or keep #{tagname} if 'tagname' not found found

Definition at line 199 of file MyGUI_LanguageManager.cpp.

## ◆ setCurrentLanguage()

void MyGUI::LanguageManager::setCurrentLanguage | ( | std::string_view | _name | ) |

Set current language for replacing #{} tags

Definition at line 104 of file MyGUI_LanguageManager.cpp.

## ◆ shutdown()

void MyGUI::LanguageManager::shutdown | ( |  | ) |

Definition at line 38 of file MyGUI_LanguageManager.cpp.

## Field Documentation

## ◆ eventChangeLanguage

delegates::MultiDelegate<const std::string&> MyGUI::LanguageManager::eventChangeLanguage

Event : Change current language.
signature : void method(const std::string& _language);

Parameters

  _language | Current language.

Definition at line 57 of file MyGUI_LanguageManager.h.

## ◆ eventRequestTag

delegates::Delegate<const UString&, UString&> MyGUI::LanguageManager::eventRequestTag

Event : Request tag.
signature : void method(const MyGUI::UString& _tag, MyGUI::UString& _result);

Parameters

  _tag | Tag than should be translated.
  _result | String that should be placed instead specified tag.

Note
  If this event is empty and _tag not found - "#{_tag}" used by default.

Definition at line 65 of file MyGUI_LanguageManager.h.

The documentation for this class was generated from the following files:

- MyGUI_LanguageManager.h
- MyGUI_LanguageManager.cpp