summaryrefslogtreecommitdiff
path: root/src/gui/helpwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-06 23:16:34 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-06 23:16:34 +0300
commit2c08dd3a145da904c6ceb5993435277a401b0408 (patch)
tree30987c26b89c331c08a18d313afd53e4148c47c5 /src/gui/helpwindow.cpp
parentcefcd0ba62d96a16419fd428a4943621f39548c3 (diff)
downloadplus-2c08dd3a145da904c6ceb5993435277a401b0408.tar.gz
plus-2c08dd3a145da904c6ceb5993435277a401b0408.tar.bz2
plus-2c08dd3a145da904c6ceb5993435277a401b0408.tar.xz
plus-2c08dd3a145da904c6ceb5993435277a401b0408.zip
Add support for help pages translations.
Diffstat (limited to 'src/gui/helpwindow.cpp')
-rw-r--r--src/gui/helpwindow.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/helpwindow.cpp b/src/gui/helpwindow.cpp
index c67fa8424..a4370d516 100644
--- a/src/gui/helpwindow.cpp
+++ b/src/gui/helpwindow.cpp
@@ -22,6 +22,8 @@
#include "gui/helpwindow.h"
+#include "log.h"
+
#include "gui/gui.h"
#include "gui/setup.h"
@@ -95,12 +97,22 @@ void HelpWindow::loadHelp(const std::string &helpFile)
void HelpWindow::loadFile(const std::string &file)
{
+ const std::string lang = getLang();
ResourceManager *resman = ResourceManager::getInstance();
std::string helpPath = branding.getStringValue("helpPath");
if (helpPath.empty())
helpPath = paths.getStringValue("help");
- std::vector<std::string> lines =
- resman->loadTextFile(helpPath + file + ".txt");
+
+ std::vector<std::string> lines;
+ if (!lang.empty())
+ {
+ const std::string name = helpPath + lang + "/" + file + ".txt";
+ if (resman->exists(name))
+ lines = resman->loadTextFile(name);
+ }
+
+ if (lines.empty())
+ lines = resman->loadTextFile(helpPath + file + ".txt");
for (unsigned int i = 0; i < lines.size(); ++i)
mBrowserBox->addRow(lines[i]);