Fully revert Translation resource idea

This commit is contained in:
Mark Watkins 2014-06-16 10:16:49 +10:00
parent a96cff0047
commit ecfde2869e
2 changed files with 16 additions and 9 deletions

View File

@ -72,7 +72,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
ui->splitter_2->setSizes(a); ui->splitter_2->setSizes(a);
ui->splitter_2->setStretchFactor(1,1); ui->splitter_2->setStretchFactor(1,1);
layout=new QHBoxLayout(ui->graphMainArea); layout=new QHBoxLayout();
layout->setSpacing(0); layout->setSpacing(0);
layout->setMargin(0); layout->setMargin(0);
layout->setContentsMargins(0,0,0,0); layout->setContentsMargins(0,0,0,0);

View File

@ -65,7 +65,7 @@ void initTranslations(QSettings & settings) {
// Add default language (English) // Add default language (English)
const QString en="en"; const QString en="en";
langFiles[en]=""; langFiles[en]="English.en.qm";
langNames[en]="English"; langNames[en]="English";
// Scan through available translations, and add them to the list // Scan through available translations, and add them to the list
@ -121,6 +121,9 @@ void initTranslations(QSettings & settings) {
for (QHash<QString, QString>::iterator it = langNames.begin(); it != langNames.end(); ++it) { for (QHash<QString, QString>::iterator it = langNames.begin(); it != langNames.end(); ++it) {
const QString & code = it.key(); const QString & code = it.key();
const QString & name = it.value(); const QString & name = it.value();
if (!langFiles.contains(code) || langFiles[code].isEmpty())
continue;
QListWidgetItem *item = new QListWidgetItem(name); QListWidgetItem *item = new QListWidgetItem(name);
item->setData(Qt::UserRole, code); item->setData(Qt::UserRole, code);
langlist.insertItem(row++, item); langlist.insertItem(row++, item);
@ -146,6 +149,7 @@ void initTranslations(QSettings & settings) {
langname=langNames[language]; langname=langNames[language];
langfile=langFiles[language]; langfile=langFiles[language];
if (language.compare("en") != 0) {
qDebug() << "Loading " << langname << " Translation" << langfile << "from" << transdir; qDebug() << "Loading " << langname << " Translation" << langfile << "from" << transdir;
QTranslator * translator = new QTranslator(); QTranslator * translator = new QTranslator();
@ -154,4 +158,7 @@ void initTranslations(QSettings & settings) {
} }
qApp->installTranslator(translator); qApp->installTranslator(translator);
} else {
qDebug() << "Using in-built english Translation";
}
} }