mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-24 04:57:45 +00:00
karuku: Support localization
This commit is contained in:
parent
98036249fb
commit
4ca38efc57
3 changed files with 13 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
#include <KLocalizedString>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <physis.hpp>
|
#include <physis.hpp>
|
||||||
#include <physis_logger.h>
|
#include <physis_logger.h>
|
||||||
|
@ -13,10 +14,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
customizeAboutData(QStringLiteral("karuku"),
|
customizeAboutData(QStringLiteral("karuku"), QStringLiteral("zone.xiv.karaku"), QStringLiteral("Excel Editor"), i18n("Program to view FFXIV Excel files."));
|
||||||
QStringLiteral("zone.xiv.karaku"),
|
|
||||||
QStringLiteral("Excel Editor"),
|
|
||||||
QStringLiteral("Program to view FFXIV Excel files."));
|
|
||||||
|
|
||||||
// Default to a sensible message pattern
|
// Default to a sensible message pattern
|
||||||
if (qEnvironmentVariableIsEmpty("QT_MESSAGE_PATTERN")) {
|
if (qEnvironmentVariableIsEmpty("QT_MESSAGE_PATTERN")) {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include <KLocalizedString>
|
||||||
#include <KZip>
|
#include <KZip>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
@ -80,10 +81,10 @@ static bool copyDirectory(const QString &srcFilePath, const QString &tgtFilePath
|
||||||
|
|
||||||
void MainWindow::setupFileMenu(QMenu *menu)
|
void MainWindow::setupFileMenu(QMenu *menu)
|
||||||
{
|
{
|
||||||
auto openList = menu->addAction(QStringLiteral("Import Definitions..."));
|
auto openList = menu->addAction(i18nc("@action:inmenu", "Import Definitions..."));
|
||||||
openList->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
|
openList->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
|
||||||
connect(openList, &QAction::triggered, [this] {
|
connect(openList, &QAction::triggered, [this] {
|
||||||
auto fileName = QFileDialog::getExistingDirectory(nullptr, QStringLiteral("Open Defintions Directory"), QStringLiteral("~"));
|
auto fileName = QFileDialog::getExistingDirectory(nullptr, i18nc("@title:window", "Open Defintions Directory"), QStringLiteral("~"));
|
||||||
|
|
||||||
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||||
const QDir definitionsDir = dataDir.absoluteFilePath(QStringLiteral("definitions"));
|
const QDir definitionsDir = dataDir.absoluteFilePath(QStringLiteral("definitions"));
|
||||||
|
@ -97,16 +98,16 @@ void MainWindow::setupFileMenu(QMenu *menu)
|
||||||
|
|
||||||
copyDirectory(fileName, definitionsDir.absolutePath());
|
copyDirectory(fileName, definitionsDir.absolutePath());
|
||||||
|
|
||||||
QMessageBox::information(this, QStringLiteral("Definitions"), QStringLiteral("Successfully imported definitions!"));
|
QMessageBox::information(this, i18nc("@title:window", "Definitions"), i18n("Successfully imported definitions!"));
|
||||||
});
|
});
|
||||||
|
|
||||||
auto downloadList = menu->addAction(QStringLiteral("Download Definitions..."));
|
auto downloadList = menu->addAction(i18nc("@action:inmenu", "Download Definitions..."));
|
||||||
downloadList->setIcon(QIcon::fromTheme(QStringLiteral("download-symbolic")));
|
downloadList->setIcon(QIcon::fromTheme(QStringLiteral("download-symbolic")));
|
||||||
connect(downloadList, &QAction::triggered, [this] {
|
connect(downloadList, &QAction::triggered, [this] {
|
||||||
const int ret =
|
const int ret =
|
||||||
QMessageBox::information(this,
|
QMessageBox::information(this,
|
||||||
QStringLiteral("Download Confirmation"),
|
i18nc("@title:window", "Download Confirmation"),
|
||||||
QStringLiteral("This will download the definitions from the <a "
|
i18n("This will download the definitions from the <a "
|
||||||
"href=\"https://github.com/xivapi/SaintCoinach\">SaintCoinach repository on GitHub</a>.<br><br>Continue?"),
|
"href=\"https://github.com/xivapi/SaintCoinach\">SaintCoinach repository on GitHub</a>.<br><br>Continue?"),
|
||||||
QMessageBox::Ok | QMessageBox::Cancel,
|
QMessageBox::Ok | QMessageBox::Cancel,
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
|
@ -155,7 +156,7 @@ void MainWindow::setupFileMenu(QMenu *menu)
|
||||||
|
|
||||||
archive.close();
|
archive.close();
|
||||||
|
|
||||||
QMessageBox::information(this, QStringLiteral("Definitions"), QStringLiteral("Successfully downloaded and imported definitions!"));
|
QMessageBox::information(this, i18nc("@title:window", "Definitions"), i18n("Successfully downloaded and imported definitions!"));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "sheetlistwidget.h"
|
#include "sheetlistwidget.h"
|
||||||
|
|
||||||
|
#include <KLocalizedString>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
|
@ -22,7 +23,7 @@ SheetListWidget::SheetListWidget(GameData *data, QWidget *parent)
|
||||||
searchModel->setFilterCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
searchModel->setFilterCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
||||||
|
|
||||||
auto searchEdit = new QLineEdit();
|
auto searchEdit = new QLineEdit();
|
||||||
searchEdit->setPlaceholderText(QStringLiteral("Search..."));
|
searchEdit->setPlaceholderText(i18nc("@info:placeholder", "Search…"));
|
||||||
searchEdit->setClearButtonEnabled(true);
|
searchEdit->setClearButtonEnabled(true);
|
||||||
searchEdit->setProperty("_breeze_borders_sides", QVariant::fromValue(QFlags{Qt::BottomEdge}));
|
searchEdit->setProperty("_breeze_borders_sides", QVariant::fromValue(QFlags{Qt::BottomEdge}));
|
||||||
connect(searchEdit, &QLineEdit::textChanged, this, [=](const QString &text) {
|
connect(searchEdit, &QLineEdit::textChanged, this, [=](const QString &text) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue