summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-02 17:36:06 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-02 17:36:06 +0300
commitadee4beacfb6865233c220e060697627d358bdb1 (patch)
treefc2133651606ab7f1879c0724810c71f1aae950c /src/gui/serverdialog.cpp
parent25a203cc7117ab67d3809f24b5fdd23a3653ef99 (diff)
downloadmanaplus-adee4beacfb6865233c220e060697627d358bdb1.tar.gz
manaplus-adee4beacfb6865233c220e060697627d358bdb1.tar.bz2
manaplus-adee4beacfb6865233c220e060697627d358bdb1.tar.xz
manaplus-adee4beacfb6865233c220e060697627d358bdb1.zip
Use translation for server descriptions in server list.
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 98d9bbfee..59bdf9660 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -511,6 +511,9 @@ void ServerDialog::loadServers(bool addNew)
return;
}
+ const std::string lang = getLangShort();
+ const std::string description2 = "description_" + lang;
+
for_each_xml_child_node(serverNode, rootNode)
{
if (!xmlNameEqual(serverNode, "server"))
@@ -560,7 +563,9 @@ void ServerDialog::loadServers(bool addNew)
server.port = defaultPortForServerType(server.type);
}
}
- else if (xmlNameEqual(subNode, "description"))
+ else if ((xmlNameEqual(subNode, "description")
+ && server.description.empty()) || (!lang.empty()
+ && xmlNameEqual(subNode, description2.c_str())))
{
server.description = reinterpret_cast<const char*>(
subNode->xmlChildrenNode->content);