Changed all strings displayed to end user to use qts localization system
This commit is contained in:
parent
cbf3238f0e
commit
31e5a0fe6d
@ -12,7 +12,7 @@ EditNotesDialog::EditNotesDialog( QString notes, QString name, QWidget* parent )
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->noteEditor->setText(notes);
|
ui->noteEditor->setText(notes);
|
||||||
setWindowTitle("Edit notes of " + m_instance_name);
|
setWindowTitle(tr("Edit notes of %1").arg(m_instance_name));
|
||||||
//connect(ui->closeButton, SIGNAL(clicked()), SLOT(close()));
|
//connect(ui->closeButton, SIGNAL(clicked()), SLOT(close()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ IconPickerDialog::IconPickerDialog(QWidget *parent) :
|
|||||||
|
|
||||||
contentsWidget->setModel(MMC->icons());
|
contentsWidget->setModel(MMC->icons());
|
||||||
|
|
||||||
auto buttonAdd = ui->buttonBox->addButton("Add Icon",QDialogButtonBox::ResetRole);
|
auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"),QDialogButtonBox::ResetRole);
|
||||||
auto buttonRemove = ui->buttonBox->addButton("Remove Icon",QDialogButtonBox::ResetRole);
|
auto buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"),QDialogButtonBox::ResetRole);
|
||||||
|
|
||||||
|
|
||||||
connect(buttonAdd,SIGNAL(clicked(bool)),SLOT(addNewIcon()));
|
connect(buttonAdd,SIGNAL(clicked(bool)),SLOT(addNewIcon()));
|
||||||
@ -87,7 +87,10 @@ bool IconPickerDialog::eventFilter ( QObject* obj, QEvent* evt)
|
|||||||
|
|
||||||
void IconPickerDialog::addNewIcon()
|
void IconPickerDialog::addNewIcon()
|
||||||
{
|
{
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Select Icons", QString(), "Icons (*.png *.jpg *.jpeg)");
|
//: The title of the select icons open file dialog
|
||||||
|
QString selectIcons = tr("Select Icons");
|
||||||
|
//: The type of icon files
|
||||||
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, selectIcons, QString(), tr("Icons") + "(*.png *.jpg *.jpeg)");
|
||||||
MMC->icons()->installIcons(fileNames);
|
MMC->icons()->installIcons(fileNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +183,8 @@ bool LegacyModEditDialog::eventFilter ( QObject* obj, QEvent* ev )
|
|||||||
|
|
||||||
void LegacyModEditDialog::on_addCoreBtn_clicked()
|
void LegacyModEditDialog::on_addCoreBtn_clicked()
|
||||||
{
|
{
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Select Core Mods");
|
//: Title of core mod selection dialog
|
||||||
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select Core Mods"));
|
||||||
for(auto filename:fileNames)
|
for(auto filename:fileNames)
|
||||||
{
|
{
|
||||||
m_coremods->stopWatching();
|
m_coremods->stopWatching();
|
||||||
@ -197,7 +198,8 @@ void LegacyModEditDialog::on_addForgeBtn_clicked()
|
|||||||
}
|
}
|
||||||
void LegacyModEditDialog::on_addJarBtn_clicked()
|
void LegacyModEditDialog::on_addJarBtn_clicked()
|
||||||
{
|
{
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Select Jar Mods");
|
//: Title of jar mod selection dialog
|
||||||
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select Jar Mods"));
|
||||||
for(auto filename:fileNames)
|
for(auto filename:fileNames)
|
||||||
{
|
{
|
||||||
m_jarmods->stopWatching();
|
m_jarmods->stopWatching();
|
||||||
@ -207,7 +209,8 @@ void LegacyModEditDialog::on_addJarBtn_clicked()
|
|||||||
}
|
}
|
||||||
void LegacyModEditDialog::on_addModBtn_clicked()
|
void LegacyModEditDialog::on_addModBtn_clicked()
|
||||||
{
|
{
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Select Loader Mods");
|
//: Title of regular mod selection dialog
|
||||||
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select Loader Mods"));
|
||||||
for(auto filename:fileNames)
|
for(auto filename:fileNames)
|
||||||
{
|
{
|
||||||
m_mods->stopWatching();
|
m_mods->stopWatching();
|
||||||
@ -217,7 +220,8 @@ void LegacyModEditDialog::on_addModBtn_clicked()
|
|||||||
}
|
}
|
||||||
void LegacyModEditDialog::on_addTexPackBtn_clicked()
|
void LegacyModEditDialog::on_addTexPackBtn_clicked()
|
||||||
{
|
{
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Select Texture Packs");
|
//: Title of texture pack selection dialog
|
||||||
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select Texture Packs"));
|
||||||
for(auto filename:fileNames)
|
for(auto filename:fileNames)
|
||||||
{
|
{
|
||||||
m_texturepacks->stopWatching();
|
m_texturepacks->stopWatching();
|
||||||
|
@ -112,7 +112,7 @@ void OneSixModEditDialog::on_buttonBox_rejected()
|
|||||||
|
|
||||||
void OneSixModEditDialog::on_addModBtn_clicked()
|
void OneSixModEditDialog::on_addModBtn_clicked()
|
||||||
{
|
{
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Select Loader Mods");
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, QApplication::translate("LegacyModEditDialog", "Select Loader Mods");
|
||||||
for(auto filename:fileNames)
|
for(auto filename:fileNames)
|
||||||
{
|
{
|
||||||
m_mods->stopWatching();
|
m_mods->stopWatching();
|
||||||
@ -139,7 +139,7 @@ void OneSixModEditDialog::on_viewModBtn_clicked()
|
|||||||
|
|
||||||
void OneSixModEditDialog::on_addResPackBtn_clicked()
|
void OneSixModEditDialog::on_addResPackBtn_clicked()
|
||||||
{
|
{
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Select Resource Packs");
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, QApplication::translate("LegacyModEditDialog", "Select Resource Packs"));
|
||||||
for(auto filename:fileNames)
|
for(auto filename:fileNames)
|
||||||
{
|
{
|
||||||
m_resourcepacks->stopWatching();
|
m_resourcepacks->stopWatching();
|
||||||
|
@ -89,7 +89,8 @@ void ConsoleWindow::on_btnKillMinecraft_clicked()
|
|||||||
{
|
{
|
||||||
ui->btnKillMinecraft->setEnabled(false);
|
ui->btnKillMinecraft->setEnabled(false);
|
||||||
QMessageBox r_u_sure;
|
QMessageBox r_u_sure;
|
||||||
r_u_sure.setText("Kill Minecraft?");
|
//: Main question of the kill confirmation dialog
|
||||||
|
r_u_sure.setText(tr("Kill Minecraft?"));
|
||||||
r_u_sure.setInformativeText("This can cause the instance to get corrupted and should only be used if Minecraft is frozen for some reason");
|
r_u_sure.setInformativeText("This can cause the instance to get corrupted and should only be used if Minecraft is frozen for some reason");
|
||||||
r_u_sure.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
r_u_sure.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||||
r_u_sure.setDefaultButton(QMessageBox::Yes);
|
r_u_sure.setDefaultButton(QMessageBox::Yes);
|
||||||
|
@ -24,8 +24,8 @@ LoginDialog::LoginDialog(QWidget *parent, const QString& loginErrMsg) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
//TODO: make translateable
|
//: Use offline mode one time
|
||||||
offlineButton = new QPushButton("Offline Once");
|
offlineButton = new QPushButton(tr("Offline Once"));
|
||||||
|
|
||||||
ui->loginButtonBox->addButton(offlineButton, QDialogButtonBox::ActionRole);
|
ui->loginButtonBox->addButton(offlineButton, QDialogButtonBox::ActionRole);
|
||||||
|
|
||||||
@ -33,8 +33,8 @@ LoginDialog::LoginDialog(QWidget *parent, const QString& loginErrMsg) :
|
|||||||
isOnline_ = true;
|
isOnline_ = true;
|
||||||
onlineForced = false;
|
onlineForced = false;
|
||||||
|
|
||||||
//FIXME: translateable?
|
//: The username during login (placeholder)
|
||||||
ui->usernameTextBox->lineEdit()->setPlaceholderText(QApplication::translate("LoginDialog", "Name", 0));
|
ui->usernameTextBox->lineEdit()->setPlaceholderText(tr("Name"));
|
||||||
|
|
||||||
connect(ui->usernameTextBox, SIGNAL(currentTextChanged(QString)), this, SLOT(userTextChanged(QString)));
|
connect(ui->usernameTextBox, SIGNAL(currentTextChanged(QString)), this, SLOT(userTextChanged(QString)));
|
||||||
connect(ui->forgetButton, SIGNAL(clicked(bool)), this, SLOT(forgetCurrentUser()));
|
connect(ui->forgetButton, SIGNAL(clicked(bool)), this, SLOT(forgetCurrentUser()));
|
||||||
|
@ -54,7 +54,7 @@ void LWJGLSelectDialog::loadingStateUpdated(bool loading)
|
|||||||
setEnabled(!loading);
|
setEnabled(!loading);
|
||||||
if (loading)
|
if (loading)
|
||||||
{
|
{
|
||||||
ui->labelStatus->setText("Loading LWJGL version list...");
|
ui->labelStatus->setText(tr("Loading LWJGL version list..."));
|
||||||
ui->labelStatus->setStyleSheet("QLabel { color: black; }");
|
ui->labelStatus->setStyleSheet("QLabel { color: black; }");
|
||||||
}
|
}
|
||||||
ui->labelStatus->setVisible(loading);
|
ui->labelStatus->setVisible(loading);
|
||||||
|
@ -587,7 +587,7 @@ void MainWindow::on_actionMakeDesktopShortcut_triggered()
|
|||||||
|
|
||||||
Util::createShortCut ( Util::getDesktopDir(), QApplication::instance()->applicationFilePath(), QStringList() << "-dl" << QDir::currentPath() << "test", name, "application-x-octet-stream" );
|
Util::createShortCut ( Util::getDesktopDir(), QApplication::instance()->applicationFilePath(), QStringList() << "-dl" << QDir::currentPath() << "test", name, "application-x-octet-stream" );
|
||||||
|
|
||||||
QMessageBox::warning ( this, "Not useful", "A Dummy Shortcut was created. it will not do anything productive" );
|
QMessageBox::warning ( this, tr("Not useful"), tr("A Dummy Shortcut was created. it will not do anything productive") );
|
||||||
}
|
}
|
||||||
|
|
||||||
// BrowserDialog
|
// BrowserDialog
|
||||||
@ -658,7 +658,7 @@ void MainWindow::selectionBad()
|
|||||||
QString iconKey = "infinity";
|
QString iconKey = "infinity";
|
||||||
statusBar()->clearMessage();
|
statusBar()->clearMessage();
|
||||||
ui->instanceToolBar->setEnabled(false);
|
ui->instanceToolBar->setEnabled(false);
|
||||||
renameButton->setText("Rename Instance");
|
renameButton->setText(tr("Rename Instance"));
|
||||||
auto ico = MMC->icons()->getIcon(iconKey);
|
auto ico = MMC->icons()->getIcon(iconKey);
|
||||||
ui->actionChangeInstIcon->setIcon(ico);
|
ui->actionChangeInstIcon->setIcon(ico);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ void SettingsDialog::updateCheckboxStuff()
|
|||||||
|
|
||||||
void SettingsDialog::on_instDirBrowseBtn_clicked()
|
void SettingsDialog::on_instDirBrowseBtn_clicked()
|
||||||
{
|
{
|
||||||
QString dir = QFileDialog::getExistingDirectory(this, "Instance Directory",
|
QString dir = QFileDialog::getExistingDirectory(this, tr("Instance Directory"),
|
||||||
ui->instDirTextBox->text());
|
ui->instDirTextBox->text());
|
||||||
if (!dir.isEmpty())
|
if (!dir.isEmpty())
|
||||||
ui->instDirTextBox->setText(dir);
|
ui->instDirTextBox->setText(dir);
|
||||||
@ -57,7 +57,7 @@ void SettingsDialog::on_instDirBrowseBtn_clicked()
|
|||||||
|
|
||||||
void SettingsDialog::on_modsDirBrowseBtn_clicked()
|
void SettingsDialog::on_modsDirBrowseBtn_clicked()
|
||||||
{
|
{
|
||||||
QString dir = QFileDialog::getExistingDirectory(this, "Mods Directory",
|
QString dir = QFileDialog::getExistingDirectory(this, tr("Mods Directory"),
|
||||||
ui->modsDirTextBox->text());
|
ui->modsDirTextBox->text());
|
||||||
if (!dir.isEmpty())
|
if (!dir.isEmpty())
|
||||||
ui->modsDirTextBox->setText(dir);
|
ui->modsDirTextBox->setText(dir);
|
||||||
@ -65,7 +65,7 @@ void SettingsDialog::on_modsDirBrowseBtn_clicked()
|
|||||||
|
|
||||||
void SettingsDialog::on_lwjglDirBrowseBtn_clicked()
|
void SettingsDialog::on_lwjglDirBrowseBtn_clicked()
|
||||||
{
|
{
|
||||||
QString dir = QFileDialog::getExistingDirectory(this, "LWJGL Directory",
|
QString dir = QFileDialog::getExistingDirectory(this, tr("LWJGL Directory"),
|
||||||
ui->lwjglDirTextBox->text());
|
ui->lwjglDirTextBox->text());
|
||||||
if (!dir.isEmpty())
|
if (!dir.isEmpty())
|
||||||
ui->lwjglDirTextBox->setText(dir);
|
ui->lwjglDirTextBox->setText(dir);
|
||||||
@ -99,9 +99,9 @@ void SettingsDialog::applySettings(SettingsObject *s)
|
|||||||
}
|
}
|
||||||
else if (!s->get("UseDevBuilds").toBool())
|
else if (!s->get("UseDevBuilds").toBool())
|
||||||
{
|
{
|
||||||
int response = QMessageBox::question(this, "Development builds",
|
int response = QMessageBox::question(this, tr("Development builds"),
|
||||||
"Development builds contain experimental features "
|
tr("Development builds contain experimental features "
|
||||||
"and may be unstable. Are you sure you want to enable them?");
|
"and may be unstable. Are you sure you want to enable them?"));
|
||||||
if (response == QMessageBox::Yes)
|
if (response == QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
s->set("UseDevBuilds", true);
|
s->set("UseDevBuilds", true);
|
||||||
|
@ -120,9 +120,11 @@ void MinecraftProcess::finish(int code, ExitStatus status)
|
|||||||
// TODO: Localization
|
// TODO: Localization
|
||||||
|
|
||||||
if (!killed)
|
if (!killed)
|
||||||
emit log("Minecraft exited.");
|
//: Message displayed on instance exit
|
||||||
|
emit log(tr("Minecraft exited with exitcode %1.").arg(status));
|
||||||
else
|
else
|
||||||
emit log("Minecraft was killed by user.", MessageLevel::Error);
|
//: Message displayed after the instance exits due to kill request
|
||||||
|
emit log(tr("Minecraft was killed by user."), MessageLevel::Error);
|
||||||
|
|
||||||
m_prepostlaunchprocess.processEnvironment().insert("INST_EXITCODE", QString(code));
|
m_prepostlaunchprocess.processEnvironment().insert("INST_EXITCODE", QString(code));
|
||||||
|
|
||||||
@ -168,7 +170,8 @@ void MinecraftProcess::launch()
|
|||||||
start(JavaPath, m_args);
|
start(JavaPath, m_args);
|
||||||
if (!waitForStarted())
|
if (!waitForStarted())
|
||||||
{
|
{
|
||||||
emit log("Could not launch minecraft!");
|
//: Error message displayed if instace can't start
|
||||||
|
emit log(tr("Could not launch minecraft!"));
|
||||||
return;
|
return;
|
||||||
//TODO: error handling
|
//TODO: error handling
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ LoginTask::LoginTask( const UserInfo& uInfo, QObject* parent ) : Task(parent), u
|
|||||||
|
|
||||||
void LoginTask::executeTask()
|
void LoginTask::executeTask()
|
||||||
{
|
{
|
||||||
setStatus("Logging in...");
|
setStatus(tr("Logging in..."));
|
||||||
auto worker = MMC->qnam();
|
auto worker = MMC->qnam();
|
||||||
connect(worker, SIGNAL(finished(QNetworkReply*)), this, SLOT(processNetReply(QNetworkReply*)));
|
connect(worker, SIGNAL(finished(QNetworkReply*)), this, SLOT(processNetReply(QNetworkReply*)));
|
||||||
|
|
||||||
@ -76,36 +76,36 @@ void LoginTask::processNetReply(QNetworkReply *reply)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
emitFailed("Failed to parse Minecraft version string.");
|
emitFailed(tr("Failed to parse Minecraft version string."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (responseStr.toLower() == "bad login")
|
if (responseStr.toLower() == "bad login")
|
||||||
emitFailed("Invalid username or password.");
|
emitFailed(tr("Invalid username or password."));
|
||||||
else if (responseStr.toLower() == "old version")
|
else if (responseStr.toLower() == "old version")
|
||||||
emitFailed("Launcher outdated, please update.");
|
emitFailed(tr("Launcher outdated, please update."));
|
||||||
else
|
else
|
||||||
emitFailed("Login failed: " + responseStr);
|
emitFailed(tr("Login failed: %1").arg(responseStr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (responseCode == 503)
|
else if (responseCode == 503)
|
||||||
{
|
{
|
||||||
emitFailed("The login servers are currently unavailable. Check http://help.mojang.com/ for more info.");
|
emitFailed(tr("The login servers are currently unavailable. Check http://help.mojang.com/ for more info."));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
emitFailed(QString("Login failed: Unknown HTTP error %1 occurred.").arg(QString::number(responseCode)));
|
emitFailed(tr("Login failed: Unknown HTTP error %1 occurred.").arg(QString::number(responseCode)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case QNetworkReply::OperationCanceledError:
|
case QNetworkReply::OperationCanceledError:
|
||||||
emitFailed("Login canceled.");
|
emitFailed(tr("Login canceled."));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
emitFailed("Login failed: " + reply->errorString());
|
emitFailed(tr("Login failed: %1").arg(reply->errorString()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user