Skip to content

Commit

Permalink
update translation
Browse files Browse the repository at this point in the history
  • Loading branch information
kaniol-lck committed Jul 12, 2024
1 parent 6178b76 commit 6b067bb
Show file tree
Hide file tree
Showing 11 changed files with 1,191 additions and 675 deletions.
918 changes: 590 additions & 328 deletions languages/zh_CN.ts

Large diffs are not rendered by default.

912 changes: 581 additions & 331 deletions languages/zh_TW.ts

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/download/qaria2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ QAria2::QAria2(QObject *parent) : QObject(parent)
connect(qApp, &QCoreApplication::aboutToQuit, this, [=]{
aria2::shutdown(session_);
MMLogger() << "aria2 shutdown.";
// FIXME: sometime app donot exit after close
// (when local mod linked)
qTerminate();
});
updateOptions();
}
Expand Down
1 change: 1 addition & 0 deletions src/images/image.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<file>modrinth/transportation.svg</file>
<file>liteloader.png</file>
<file>rift.png</file>
<file>modrinth/game-mechanics.svg</file>
</qresource>
<qresource prefix="/"/>
</RCC>
1 change: 1 addition & 0 deletions src/images/modrinth/game-mechanics.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions src/local/localmod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,27 +671,27 @@ void LocalMod::updateIcon()
emit modIconUpdated();
return;
}
auto applyIcon = [=]{
if(isDisabled()){
QImage image(icon_.toImage());
static auto applyIcon = [](LocalMod *p){
if(p->isDisabled()){
QImage image(p->icon_.toImage());
auto alphaChannel = image.convertToFormat(QImage::Format_Alpha8);
image = image.convertToFormat(QImage::Format_Grayscale8);
image.setAlphaChannel(alphaChannel);
icon_.convertFromImage(image);
p->icon_.convertFromImage(image);
}
emit modIconUpdated();
emit p->modIconUpdated();
};

if(!commonInfo()->iconBytes().isEmpty()){
icon_.loadFromData(commonInfo()->iconBytes());
applyIcon();
applyIcon(this);
}else if(commonInfo()->id() == "optifine") {
icon_.load(":/image/optifine.png");
applyIcon();
applyIcon(this);
}else if(curseforgeMod_){
auto setCurseforgeIcon = [=]{
icon_ = curseforgeMod_->modInfo().icon();
applyIcon();
applyIcon(this);
};
if(!curseforgeMod_->modInfo().icon().isNull())
setCurseforgeIcon();
Expand All @@ -705,7 +705,7 @@ void LocalMod::updateIcon()
} else if(modrinthMod_){
auto setModrinthIcon = [=]{
icon_ = modrinthMod_->modInfo().icon();
applyIcon();
applyIcon(this);
};
if(!modrinthMod_->modInfo().icon().isNull())
setModrinthIcon();
Expand All @@ -718,7 +718,7 @@ void LocalMod::updateIcon()
}
} else{
icon_.load(":/image/modmanager.png");
applyIcon();
applyIcon(this);
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/local/localmodfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ LocalModFile::~LocalModFile()

ModLoaderType::Type LocalModFile::loadInfo()
{
auto timer = new QElapsedTimer;
timer->start();
// auto timer = new QElapsedTimer;
// timer->start();
if(type() == NotMod) return ModLoaderType::Any;
QFile modFile(path_);

Expand Down Expand Up @@ -87,7 +87,6 @@ ModLoaderType::Type LocalModFile::loadInfo()
}
}


//qDebug() << "finish" << timer->elapsed();

//for count
Expand Down
2 changes: 1 addition & 1 deletion src/local/localmodpath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void LocalModPath::loadMods(bool autoLoaderType)
//delete unused files
nonModFiles_.clear();
for(const auto &file : qAsConst(modFileList)){
if(!file->parent()){
if(file->parent() == this){
nonModFiles_ << file->fileInfo().fileName();
file->deleteLater();
}
Expand Down
1 change: 1 addition & 0 deletions src/modrinth/modrinthapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ const QList<std::tuple<QString, QString> > &ModrinthAPI::getCategories()
{ tr("Economy"), "economy" },
{ tr("Equipment"), "equipment" },
{ tr("Food"), "food" },
{ tr("Game Mechanics"), "game-mechanics" },
{ tr("Library"), "library" },
{ tr("Magic"), "magic" },
{ tr("Management"), "management" },
Expand Down
1 change: 0 additions & 1 deletion src/modrinth/modrinthmodinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ ModrinthModInfo ModrinthModInfo::fromVariant(const QVariant &variant)
if(it != ModrinthAPI::getCategories().end()){
auto [name, iconName] = *it;
modInfo.importTag(Tag(name, TagCategory::ModrinthCategory, ":/image/modrinth/" + iconName));
qDebug() << iconName;
} else if(auto loaderType = ModLoaderType::fromString(categoryId);
loaderType != ModLoaderType::Any && ModLoaderType::modrinth.contains(loaderType)){
modInfo.loaderTypes_ << loaderType;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/modmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void ModManager::updateLockPanels()
void ModManager::closeEvent(QCloseEvent *event[[maybe_unused]])
{
emit closed();
// qDebug() << "closed";
qDebug() << "closed";
}

#if defined (DE_KDE) || defined (Q_OS_WIN)
Expand Down

0 comments on commit 6b067bb

Please sign in to comment.