summaryrefslogtreecommitdiff
path: root/src/resources/db/itemdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-21 20:36:23 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-21 20:37:02 +0300
commite465ecdf0c7f867a62236a5a0945a85f35eee039 (patch)
tree7bc97c683d542f11a1f5b069e77cf70f552d14fe /src/resources/db/itemdb.cpp
parent862e8f821789014b6167f37976b80694d6d310e3 (diff)
downloadplus-e465ecdf0c7f867a62236a5a0945a85f35eee039.tar.gz
plus-e465ecdf0c7f867a62236a5a0945a85f35eee039.tar.bz2
plus-e465ecdf0c7f867a62236a5a0945a85f35eee039.tar.xz
plus-e465ecdf0c7f867a62236a5a0945a85f35eee039.zip
Show item options in item popups.
Diffstat (limited to 'src/resources/db/itemdb.cpp')
-rw-r--r--src/resources/db/itemdb.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index 77ff5b269..94c9b14b8 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -46,6 +46,8 @@
#include "utils/dtor.h"
#include "utils/stringmap.h"
+#include "utils/translation/podict.h"
+
#include "debug.h"
namespace
@@ -127,6 +129,9 @@ static void readFields(std::string &effect,
XmlNodeConstPtr node,
const ItemFieldDb::FieldInfos &fields)
{
+ if (!translator)
+ return;
+
FOR_EACH (ItemFieldDb::FieldInfos::const_iterator, it, fields)
{
const std::string fieldName = (*it).first;
@@ -141,7 +146,8 @@ static void readFields(std::string &effect,
effect.append(" / ");
if (field->sign && isDigit(value))
value = "+" + value;
- effect.append(strprintf(gettext(field->description.c_str()),
+ const std::string format = translator->getStr(field->description);
+ effect.append(strprintf(format.c_str(),
value.c_str()));
}
}