diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-02 17:36:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-02 17:36:06 +0300 |
commit | adee4beacfb6865233c220e060697627d358bdb1 (patch) | |
tree | fc2133651606ab7f1879c0724810c71f1aae950c /src/gui/serverdialog.cpp | |
parent | 25a203cc7117ab67d3809f24b5fdd23a3653ef99 (diff) | |
download | mv-adee4beacfb6865233c220e060697627d358bdb1.tar.gz mv-adee4beacfb6865233c220e060697627d358bdb1.tar.bz2 mv-adee4beacfb6865233c220e060697627d358bdb1.tar.xz mv-adee4beacfb6865233c220e060697627d358bdb1.zip |
Use translation for server descriptions in server list.
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r-- | src/gui/serverdialog.cpp | 7 |
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); |