From f99ee017f2ac6b03a6bc6122cb78923a9b4f6a5f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 18 Mar 2012 23:05:10 +0300 Subject: Add help po translation. Combine help and client data translations. --- src/gui/didyouknowwindow.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/gui/didyouknowwindow.cpp') diff --git a/src/gui/didyouknowwindow.cpp b/src/gui/didyouknowwindow.cpp index a6b89923e..a071e1ffc 100644 --- a/src/gui/didyouknowwindow.cpp +++ b/src/gui/didyouknowwindow.cpp @@ -39,6 +39,9 @@ #include "utils/gettext.h" #include "utils/langs.h" +#include "utils/translation/podict.h" +#include "utils/translation/translationmanager.h" + #include "debug.h" static const int minTip = 1; @@ -129,26 +132,13 @@ void DidYouKnowWindow::loadFile(int num) { const std::string file = strprintf("tips/%d", num); const std::vector langs = getLang(); - ResourceManager *resman = ResourceManager::getInstance(); std::string helpPath = branding.getStringValue("helpPath"); if (helpPath.empty()) helpPath = paths.getStringValue("help"); std::vector lines; - if (!langs.empty()) - { - std::string name = helpPath + langs[0] + "/" + file + ".txt"; - if (resman->exists(name)) - resman->loadTextFile(name, lines); - if (lines.empty() && langs.size() > 1) - { - name = helpPath + langs[1] + "/" + file + ".txt"; - resman->loadTextFile(name, lines); - } - } - - if (lines.empty()) - resman->loadTextFile(helpPath + file + ".txt", lines); + TranslationManager::translateFile(helpPath + file + ".txt", + translator, lines); for (unsigned int i = 0; i < lines.size(); ++i) mBrowserBox->addRow(lines[i]); -- cgit v1.2.3-60-g2f50