removed old temporary phrase and formatPrase implementations
This commit is contained in:
1 parent
6e634e13d2
commit
e96b871779
14 files changed
+231
-598
No files matched your search
@@ -49,19 +49,6 @@ namespace Enhance {
|
||||
|
||||
namespace {
|
||||
|
||||
// TODO: needs Phrases[] (StringTables.pas not ported) - plain English
|
||||
// literals until localization is ported.
|
||||
QString phrase(const QString &key)
|
||||
{
|
||||
static const QHash<QString, QString> table = {
|
||||
{QStringLiteral("TITLE_ENHANCE"), QStringLiteral("Enhance terrain")},
|
||||
{QStringLiteral("BTN_SELECT"), QStringLiteral("Select terrain")},
|
||||
{QStringLiteral("TWOTERRAINS"), QStringLiteral("%1/%2")},
|
||||
};
|
||||
const auto it = table.constFind(key);
|
||||
return it != table.constEnd() ? *it : key;
|
||||
}
|
||||
|
||||
QString terrainName(int terrType)
|
||||
{
|
||||
return phrases.lookup(QStringLiteral("TERRAIN"), terrType);
|
||||
@@ -81,8 +68,8 @@ EnhanceDlg::EnhanceDlg(QWidget *parent) : FramedDlg(parent), ui(new Ui::EnhanceD
|
||||
captionRight = ui->closeBtn->x();
|
||||
captionLeft = ui->toggleBtn->x() + ui->toggleBtn->width();
|
||||
initButtons();
|
||||
setWindowTitle(phrase(QStringLiteral("TITLE_ENHANCE")));
|
||||
ui->toggleBtn->setToolTip(phrase(QStringLiteral("BTN_SELECT")));
|
||||
setWindowTitle(phrases.lookup(QStringLiteral("TITLE_ENHANCE")));
|
||||
ui->toggleBtn->setToolTip(phrases.lookup(QStringLiteral("BTN_SELECT")));
|
||||
|
||||
popup = new QMenu(this);
|
||||
for (int terrType = fGrass; terrType <= fMountains; ++terrType) {
|
||||
@@ -90,9 +77,9 @@ EnhanceDlg::EnhanceDlg(QWidget *parent) : FramedDlg(parent), ui(new Ui::EnhanceD
|
||||
continue;
|
||||
QString caption;
|
||||
if (terrType == fGrass)
|
||||
caption = phrase(QStringLiteral("TWOTERRAINS")).arg(terrainName(fGrass)).arg(terrainName(fGrass + 12));
|
||||
caption = formatPhrase(QStringLiteral("TWOTERRAINS"), { terrainName(fGrass), terrainName(fGrass + 12) });
|
||||
else if (terrType == fForest)
|
||||
caption = phrase(QStringLiteral("TWOTERRAINS")).arg(terrainName(fForest)).arg(terrainName(Term::fJungle));
|
||||
caption = formatPhrase(QStringLiteral("TWOTERRAINS"), { terrainName(fForest), terrainName(Term::fJungle) });
|
||||
else
|
||||
caption = terrainName(terrType);
|
||||
QAction *action = popup->addAction(caption);
|
||||
|
||||
Reference in new issue
Block a user