1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-02 17:52:54 +03:00

The translations can now be located on the system directory, or on the user-specific directory.

The language selector on gmenu2x's settings will list the languages present on both directories.
This commit is contained in:
Ayla 2011-04-12 09:59:32 +02:00
parent 301e16e8ee
commit c18c230f7a
2 changed files with 9 additions and 2 deletions

View File

@ -1121,8 +1121,11 @@ void GMenu2X::options() {
int prevbacklight = confInt["backlight"];
bool showRootFolder = fileExists(CARD_ROOT);
FileLister fl_tr("translations");
FileLister fl_tr(GMENU2X_SYSTEM_DIR "/translations");
fl_tr.browse();
fl_tr.setPath(getHome() + "/translations", false);
fl_tr.browse(false);
fl_tr.insertFile("English");
string lang = tr.lang();

View File

@ -25,6 +25,7 @@
#include "translator.h"
#include "debug.h"
#include "gmenu2x.h"
using namespace std;
@ -44,7 +45,10 @@ void Translator::setLang(const string &lang) {
translations.clear();
string line;
ifstream infile (string("translations/"+lang).c_str(), ios_base::in);
ifstream infile ((GMenu2X::getHome() + "/translations/" + lang).c_str(), ios_base::in);
if (!infile.is_open())
infile.open((string(GMENU2X_SYSTEM_DIR "/translations/") + lang).c_str(), ios_base::in);
if (infile.is_open()) {
while (getline(infile, line, '\n')) {
line = trim(line);