summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-18 03:10:10 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-18 03:10:10 +0300
commit74d12df575b7d2cf7e95407df80dbb699ca9806e (patch)
treea03aae01ae6e458b4fd1feecc99265d17da57627 /src/gui
parent4a83474614ed67349b83c742b8498937b2e190e7 (diff)
downloadmanaverse-74d12df575b7d2cf7e95407df80dbb699ca9806e.tar.gz
manaverse-74d12df575b7d2cf7e95407df80dbb699ca9806e.tar.bz2
manaverse-74d12df575b7d2cf7e95407df80dbb699ca9806e.tar.xz
manaverse-74d12df575b7d2cf7e95407df80dbb699ca9806e.zip
Allow try different language part for searching help translations.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/helpwindow.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/helpwindow.cpp b/src/gui/helpwindow.cpp
index e366712e7..e31782b8b 100644
--- a/src/gui/helpwindow.cpp
+++ b/src/gui/helpwindow.cpp
@@ -98,18 +98,23 @@ void HelpWindow::loadHelp(const std::string &helpFile)
void HelpWindow::loadFile(const std::string &file)
{
- const std::string lang = getLang();
+ const std::vector<std::string> langs = getLang();
ResourceManager *resman = ResourceManager::getInstance();
std::string helpPath = branding.getStringValue("helpPath");
if (helpPath.empty())
helpPath = paths.getStringValue("help");
std::vector<std::string> lines;
- if (!lang.empty())
+ if (!langs.empty())
{
- const std::string name = helpPath + lang + "/" + file + ".txt";
+ std::string name = helpPath + langs[0] + "/" + file + ".txt";
if (resman->exists(name))
lines = resman->loadTextFile(name);
+ if (lines.empty() && langs.size() > 1)
+ {
+ name = helpPath + langs[1] + "/" + file + ".txt";
+ lines = resman->loadTextFile(name);
+ }
}
if (lines.empty())