summaryrefslogtreecommitdiff
path: root/src/utils/xml.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-19 15:49:45 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-19 15:49:45 +0300
commitb30a5d2289a0b68410dee5343e148aba88ea4839 (patch)
tree9d756785b9166ced76675ad3ebe398c09b494a3c /src/utils/xml.cpp
parent9a3a196dbf633a699c26d0227802a42f025c8bfd (diff)
parent164e4ed5a153ce06badb52f3a5a4dff16c58d7e6 (diff)
downloadManaVerse-b30a5d2289a0b68410dee5343e148aba88ea4839.tar.gz
ManaVerse-b30a5d2289a0b68410dee5343e148aba88ea4839.tar.bz2
ManaVerse-b30a5d2289a0b68410dee5343e148aba88ea4839.tar.xz
ManaVerse-b30a5d2289a0b68410dee5343e148aba88ea4839.zip
Merge branch 'master' into stripped
Diffstat (limited to 'src/utils/xml.cpp')
-rw-r--r--src/utils/xml.cpp12
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);