diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-03 15:53:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-05 22:53:59 +0300 |
commit | bf435a79408d89072f5872ab98449949a8a077b0 (patch) | |
tree | e50bddcd239de2756780691cabf8779dd5efcc12 /src/utils/xml.cpp | |
parent | 42990fcd0a9f662eea267097e88b68b9c30da457 (diff) | |
download | manaplus-bf435a79408d89072f5872ab98449949a8a077b0.tar.gz manaplus-bf435a79408d89072f5872ab98449949a8a077b0.tar.bz2 manaplus-bf435a79408d89072f5872ab98449949a8a077b0.tar.xz manaplus-bf435a79408d89072f5872ab98449949a8a077b0.zip |
Add own translation system.
Diffstat (limited to 'src/utils/xml.cpp')
-rw-r--r-- | src/utils/xml.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 420915d8f..140da72df 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -26,6 +26,8 @@ #include "resources/resourcemanager.h" +#include "utils/translation/podict.h" + #include <iostream> #include <fstream> #include <cstring> @@ -148,6 +150,16 @@ namespace XML return def; } + std::string langProperty(XmlNodePtr node, const char *name, + const std::string &def) + { + std::string str = getProperty(node, name, def); + if (!translator) + return str; + + return translator->getStr(str); + } + bool getBoolProperty(XmlNodePtr node, const char* name, bool def) { xmlChar *prop = xmlGetProp(node, BAD_CAST name); |