Skip to content

Commit

Permalink
openmw-cn: v1-v9
Browse files Browse the repository at this point in the history
  • Loading branch information
dwing4g committed Jan 31, 2024
1 parent b6b497c commit e9c567e
Show file tree
Hide file tree
Showing 76 changed files with 50,685 additions and 487 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ elseif(NOT APPLE)
ENDIF(BUILD_OPENMW)
IF(BUILD_LAUNCHER)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/openmw-launcher" DESTINATION "${BINDIR}" )
INSTALL(PROGRAMS "${INSTALL_SOURCE}/pinyin.txt" DESTINATION "${BINDIR}" )
ENDIF(BUILD_LAUNCHER)
IF(BUILD_BSATOOL)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/bsatool" DESTINATION "${BINDIR}" )
Expand Down
34 changes: 21 additions & 13 deletions apps/launcher/datafilespage.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "datafilespage.hpp"
#include "datafilespage.hpp"
#include "maindialog.hpp"

#include <QDebug>
Expand Down Expand Up @@ -147,15 +147,15 @@ Launcher::DataFilesPage::DataFilesPage(const Files::ConfigurationManager& cfg, C

QVector<std::pair<QString, QString>> languages = { { "English", tr("English") }, { "French", tr("French") },
{ "German", tr("German") }, { "Italian", tr("Italian") }, { "Polish", tr("Polish") },
{ "Russian", tr("Russian") }, { "Spanish", tr("Spanish") } };
{ "Russian", tr("Russian") }, { "Spanish", tr("Spanish") }, { "Chinese(GBK)", tr("Chinese(GBK)") }, { "UTF-8", tr("UTF-8") } };

for (auto lang : languages)
{
mSelector->languageBox()->addItem(lang.second, lang.first);
}

mNewProfileDialog = new TextInputDialog(tr("New Content List"), tr("Content List name:"), this);
mCloneProfileDialog = new TextInputDialog(tr("Clone Content List"), tr("Content List name:"), this);
mNewProfileDialog = new TextInputDialog(tr("新内容列表"), tr("内容列表名:"), this);
mCloneProfileDialog = new TextInputDialog(tr("克隆内容列表"), tr("内容列表名:"), this);

connect(mNewProfileDialog->lineEdit(), &LineEdit::textChanged, this, &DataFilesPage::updateNewProfileOkButton);
connect(mCloneProfileDialog->lineEdit(), &LineEdit::textChanged, this, &DataFilesPage::updateCloneProfileOkButton);
Expand Down Expand Up @@ -185,13 +185,13 @@ void Launcher::DataFilesPage::buildView()
QToolButton* refreshButton = mSelector->refreshButton();

// tool buttons
ui.newProfileButton->setToolTip("Create a new Content List");
ui.cloneProfileButton->setToolTip("Clone the current Content List");
ui.deleteProfileButton->setToolTip("Delete an existing Content List");
ui.newProfileButton->setToolTip("创建一个内容列表");
ui.cloneProfileButton->setToolTip("克隆当前的内容列表");
ui.deleteProfileButton->setToolTip("删除已存在的内容列表");

// combo box
ui.profilesComboBox->addItem(mDefaultContentListName);
ui.profilesComboBox->setPlaceholderText(QString("Select a Content List..."));
ui.profilesComboBox->setPlaceholderText(QString("选择一个内容列表..."));
ui.profilesComboBox->setCurrentIndex(ui.profilesComboBox->findText(QLatin1String(mDefaultContentListName)));

// Add the actions to the toolbuttons
Expand Down Expand Up @@ -308,7 +308,7 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
// Display new content with custom formatting
if (mNewDataDirs.contains(canonicalDirPath))
{
tooltip += "Will be added to the current profile\n";
tooltip += "将会加入当前配置\n";
QFont font = item->font();
font.setBold(true);
font.setItalic(true);
Expand All @@ -326,7 +326,7 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
if (mSelector->containsDataFiles(currentDir))
{
item->setIcon(QIcon(":/images/openmw-plugin.png"));
tooltip += "Contains content file(s)";
tooltip += "包含内容文件";
}
else
{
Expand Down Expand Up @@ -401,6 +401,14 @@ void Launcher::DataFilesPage::saveSettings(const QString& profile)
{
mGameSettings.setValue(QLatin1String("encoding"), QLatin1String("win1251"));
}
else if (language == QLatin1String("Chinese(GBK)"))
{
mGameSettings.setValue(QLatin1String("encoding"), QLatin1String("gbk"));
}
else if (language == QLatin1String("UTF-8"))
{
mGameSettings.setValue(QLatin1String("encoding"), QLatin1String("utf8"));
}
else
{
mGameSettings.setValue(QLatin1String("encoding"), QLatin1String("win1252"));
Expand Down Expand Up @@ -838,12 +846,12 @@ void Launcher::DataFilesPage::checkForDefaultProfile()
bool Launcher::DataFilesPage::showDeleteMessageBox(const QString& text)
{
QMessageBox msgBox(this);
msgBox.setWindowTitle(tr("Delete Content List"));
msgBox.setWindowTitle(tr("删除内容列表"));
msgBox.setIcon(QMessageBox::Warning);
msgBox.setStandardButtons(QMessageBox::Cancel);
msgBox.setText(tr("Are you sure you want to delete <b>%1</b>?").arg(text));
msgBox.setText(tr("你确定要删除 <b>%1</b>?").arg(text));

QAbstractButton* deleteButton = msgBox.addButton(tr("Delete"), QMessageBox::ActionRole);
QAbstractButton* deleteButton = msgBox.addButton(tr("删除"), QMessageBox::ActionRole);

msgBox.exec();

Expand Down
16 changes: 8 additions & 8 deletions apps/launcher/graphicspage.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "graphicspage.hpp"
#include "graphicspage.hpp"

#include "sdlinit.hpp"

Expand Down Expand Up @@ -49,11 +49,11 @@ bool Launcher::GraphicsPage::setupSDL()
if (displays < 0)
{
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Error receiving number of screens"));
msgBox.setWindowTitle(tr("获取屏幕数出错"));
msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(
tr("<br><b>SDL_GetNumVideoDisplays failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
tr("<br><b>SDL_GetNumVideoDisplays 失败:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec();
return false;
}
Expand All @@ -63,7 +63,7 @@ bool Launcher::GraphicsPage::setupSDL()
for (int i = 0; i < displays; i++)
{
mResolutionsPerScreen.append(getAvailableResolutions(i));
screenComboBox->addItem(QString(tr("Screen ")) + QString::number(i + 1));
screenComboBox->addItem(QString(tr("屏幕 ")) + QString::number(i + 1));
}
screenChanged(0);

Expand Down Expand Up @@ -178,11 +178,11 @@ QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen)
if (modes < 0)
{
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Error receiving resolutions"));
msgBox.setWindowTitle(tr("获取分辨率出错"));
msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(
tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
tr("<br><b>SDL_GetNumDisplayModes 失败:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec();
return result;
}
Expand All @@ -192,11 +192,11 @@ QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen)
if (SDL_GetDisplayMode(screen, modeIndex, &mode) < 0)
{
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Error receiving resolutions"));
msgBox.setWindowTitle(tr("获取分辨率出错"));
msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(
tr("<br><b>SDL_GetDisplayMode failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
tr("<br><b>SDL_GetDisplayMode 失败:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec();
return result;
}
Expand Down
18 changes: 9 additions & 9 deletions apps/launcher/importpage.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "importpage.hpp"
#include "importpage.hpp"

#include <QDebug>
#include <QDir>
Expand Down Expand Up @@ -100,13 +100,13 @@ void Launcher::ImportPage::on_importerButton_clicked()
{
// File cannot be created
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Error writing OpenMW configuration file"));
msgBox.setWindowTitle(tr("写入 OpenMW 配置文件出错"));
msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(
tr("<html><head/><body><p><b>Could not open or create %1 for writing </b></p>"
"<p>Please make sure you have the right permissions "
"and try again.</p></body></html>")
tr("<html><head/><body><p><b>无法创建或写入 %1</b></p>"
"<p>请确认你有相关权限"
"并再次尝试。</p></body></html>")
.arg(file.fileName()));
msgBox.exec();
return;
Expand Down Expand Up @@ -144,8 +144,8 @@ void Launcher::ImportPage::on_importerButton_clicked()

void Launcher::ImportPage::on_browseButton_clicked()
{
QString iniFile = QFileDialog::getOpenFileName(this, QObject::tr("Select configuration file"), QDir::currentPath(),
QString(tr("Morrowind configuration file (*.ini)")));
QString iniFile = QFileDialog::getOpenFileName(this, QObject::tr("选择配置文件"), QDir::currentPath(),
QString(tr("晨风配置文件 (*.ini)")));

if (iniFile.isEmpty())
return;
Expand Down Expand Up @@ -195,10 +195,10 @@ void Launcher::ImportPage::importerFinished(int exitCode, QProcess::ExitStatus e
resetProgressBar();

QMessageBox msgBox;
msgBox.setWindowTitle(tr("Importer finished"));
msgBox.setWindowTitle(tr("导入完成"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setIcon(QMessageBox::Warning);
msgBox.setText(tr("Failed to import settings from INI file."));
msgBox.setText(tr("INI 文件导入设置失败。"));
msgBox.exec();
}
else
Expand Down
Loading

0 comments on commit e9c567e

Please sign in to comment.