mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-26 05:24:03 +02: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:
parent
301e16e8ee
commit
c18c230f7a
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user