2023-09-28 15:29:43 +02:00
|
|
|
/*
|
|
|
|
* translations.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDialog>
|
2023-09-28 23:15:36 +02:00
|
|
|
#include "../lib/mapping/CMap.h"
|
2023-09-28 15:29:43 +02:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class Translations;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Translations : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2023-09-28 22:48:52 +02:00
|
|
|
|
|
|
|
void fillTranslationsTable(const std::string & language);
|
2023-09-28 15:29:43 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit Translations(CMapHeader & mapHeader, QWidget *parent = nullptr);
|
|
|
|
~Translations();
|
2023-09-28 23:15:36 +02:00
|
|
|
|
|
|
|
//removes unused string IDs from map translations
|
|
|
|
static void cleanupRemovedItems(CMap & map);
|
|
|
|
static void cleanupRemovedItems(CMap & map, const std::string & pattern);
|
2023-09-28 15:29:43 +02:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_languageSelect_currentIndexChanged(int index);
|
|
|
|
|
|
|
|
void on_supportedCheck_toggled(bool checked);
|
|
|
|
|
|
|
|
void on_translationsTable_itemChanged(QTableWidgetItem *item);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::Translations *ui;
|
|
|
|
CMapHeader & mapHeader;
|
2023-09-29 00:24:45 +02:00
|
|
|
std::string mapPreferredLanguage;
|
2023-09-28 15:29:43 +02:00
|
|
|
};
|