9 #include "../headers/Language.h"
32 doc.LoadFile(Path.c_str());
34 if(
doc.ErrorID() != 0) {
39 tinyxml2::XMLNode * root =
doc.FirstChildElement(
"HatchKeeperLanguage");
46 tinyxml2::XMLElement * lang = root->FirstChildElement(
"Language");
50 tinyxml2::XMLElement * strs = root->FirstChildElement(
"Strings");
52 for( tinyxml2::XMLElement* str = strs->FirstChildElement(); str != NULL; str = str->NextSiblingElement())
53 Add(str->Attribute(
"value"),str->GetText());
84 for(
int a = 0; a <
Count();a++) {
int Errors()
Returns Error Code.
std::vector< std::string > BaseLang
tinyxml2::XMLDocument doc
std::vector< std::string > Translated
std::string GetLanguage()
Returns What The Translated Language Is.
void Add(std::string Base, std::string Translate)
Adds Values To The Arrays This function is used internally only.
int Count()
Returns The Number Of Strings Stored In The Arrays.
void SetPath(std::string Path)
Sets/Loads Path Opens the xml language file and reads it into two arrays.
std::string GetPath()
Returns The Path For The Language File.
std::string Translate(std::string Text)
The Actual Translate Function This function checks Text against the base languages strings,...