From 03eb014d1e2fc5994946c73fb594e0b0d17ba980 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 4 Mar 2022 23:22:27 +0200 Subject: [PATCH 48/48] Ruledit: Translate rule_name / name "None" shown when no item selected See osdn #44029 Signed-off-by: Marko Lindqvist --- tools/ruledit/tab_building.cpp | 8 ++++---- tools/ruledit/tab_enablers.cpp | 2 +- tools/ruledit/tab_extras.cpp | 8 ++++---- tools/ruledit/tab_good.cpp | 8 ++++---- tools/ruledit/tab_gov.cpp | 8 ++++---- tools/ruledit/tab_multiplier.cpp | 8 ++++---- tools/ruledit/tab_tech.cpp | 10 ++++++---- tools/ruledit/tab_terrains.cpp | 8 ++++---- tools/ruledit/tab_unit.cpp | 8 ++++---- 9 files changed, 35 insertions(+), 33 deletions(-) diff --git a/tools/ruledit/tab_building.cpp b/tools/ruledit/tab_building.cpp index 7fe2f63624..a9dc50fee6 100644 --- a/tools/ruledit/tab_building.cpp +++ b/tools/ruledit/tab_building.cpp @@ -67,7 +67,7 @@ tab_building::tab_building(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Rule Name"))); label->setParent(this); rname = new QLineEdit(this); - rname->setText("None"); + rname->setText(R__("None")); connect(rname, SIGNAL(returnPressed()), this, SLOT(name_given())); bldg_layout->addWidget(label, 0, 0); bldg_layout->addWidget(rname, 0, 2); @@ -77,7 +77,7 @@ tab_building::tab_building(ruledit_gui *ui_in) : QWidget() same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); - name->setText("None"); + name->setText(R__("None")); connect(name, SIGNAL(returnPressed()), this, SLOT(name_given())); bldg_layout->addWidget(label, 1, 0); bldg_layout->addWidget(same_name, 1, 1); @@ -149,8 +149,8 @@ void tab_building::update_bldg_info(struct impr_type *pimpr) name->setEnabled(true); } } else { - name->setText("None"); - rname->setText("None"); + name->setText(R__("None")); + rname->setText(R__("None")); same_name->setChecked(true); name->setEnabled(false); } diff --git a/tools/ruledit/tab_enablers.cpp b/tools/ruledit/tab_enablers.cpp index 55242a8a6d..1b1eee36bd 100644 --- a/tools/ruledit/tab_enablers.cpp +++ b/tools/ruledit/tab_enablers.cpp @@ -236,7 +236,7 @@ void tab_enabler::update_enabler_info(struct action_enabler *enabler) break; } } else { - type_button->setText("None"); + type_button->setText(R__("None")); type_button->setEnabled(false); act_reqs_button->setEnabled(false); diff --git a/tools/ruledit/tab_extras.cpp b/tools/ruledit/tab_extras.cpp index 761c624d65..7590ba41d4 100644 --- a/tools/ruledit/tab_extras.cpp +++ b/tools/ruledit/tab_extras.cpp @@ -65,7 +65,7 @@ tab_extras::tab_extras(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Rule Name"))); label->setParent(this); rname = new QLineEdit(this); - rname->setText("None"); + rname->setText(R__("None")); connect(rname, SIGNAL(returnPressed()), this, SLOT(name_given())); extra_layout->addWidget(label, 0, 0); extra_layout->addWidget(rname, 0, 2); @@ -75,7 +75,7 @@ tab_extras::tab_extras(ruledit_gui *ui_in) : QWidget() same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); - name->setText("None"); + name->setText(R__("None")); connect(name, SIGNAL(returnPressed()), this, SLOT(name_given())); extra_layout->addWidget(label, 1, 0); extra_layout->addWidget(same_name, 1, 1); @@ -144,8 +144,8 @@ void tab_extras::update_extra_info(struct extra_type *pextra) name->setEnabled(true); } } else { - name->setText("None"); - rname->setText("None"); + name->setText(R__("None")); + rname->setText(R__("None")); same_name->setChecked(true); name->setEnabled(false); } diff --git a/tools/ruledit/tab_good.cpp b/tools/ruledit/tab_good.cpp index d3a9684d0f..702f306b43 100644 --- a/tools/ruledit/tab_good.cpp +++ b/tools/ruledit/tab_good.cpp @@ -66,7 +66,7 @@ tab_good::tab_good(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Rule Name"))); label->setParent(this); rname = new QLineEdit(this); - rname->setText("None"); + rname->setText(R__("None")); connect(rname, SIGNAL(returnPressed()), this, SLOT(name_given())); good_layout->addWidget(label, 0, 0); good_layout->addWidget(rname, 0, 2); @@ -76,7 +76,7 @@ tab_good::tab_good(ruledit_gui *ui_in) : QWidget() same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); - name->setText("None"); + name->setText(R__("None")); connect(name, SIGNAL(returnPressed()), this, SLOT(name_given())); good_layout->addWidget(label, 1, 0); good_layout->addWidget(same_name, 1, 1); @@ -145,8 +145,8 @@ void tab_good::update_good_info(struct goods_type *pgood) name->setEnabled(true); } } else { - name->setText("None"); - rname->setText("None"); + name->setText(R__("None")); + rname->setText(R__("None")); same_name->setChecked(true); name->setEnabled(false); } diff --git a/tools/ruledit/tab_gov.cpp b/tools/ruledit/tab_gov.cpp index f327ff4981..311a2c57a5 100644 --- a/tools/ruledit/tab_gov.cpp +++ b/tools/ruledit/tab_gov.cpp @@ -65,7 +65,7 @@ tab_gov::tab_gov(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Rule Name"))); label->setParent(this); rname = new QLineEdit(this); - rname->setText("None"); + rname->setText(R__("None")); connect(rname, SIGNAL(returnPressed()), this, SLOT(name_given())); gov_layout->addWidget(label, 0, 0); gov_layout->addWidget(rname, 0, 2); @@ -75,7 +75,7 @@ tab_gov::tab_gov(ruledit_gui *ui_in) : QWidget() same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); - name->setText("None"); + name->setText(R__("None")); connect(name, SIGNAL(returnPressed()), this, SLOT(name_given())); gov_layout->addWidget(label, 1, 0); gov_layout->addWidget(same_name, 1, 1); @@ -144,8 +144,8 @@ void tab_gov::update_gov_info(struct government *pgov) name->setEnabled(true); } } else { - name->setText("None"); - rname->setText("None"); + name->setText(R__("None")); + rname->setText(R__("None")); same_name->setChecked(true); name->setEnabled(false); } diff --git a/tools/ruledit/tab_multiplier.cpp b/tools/ruledit/tab_multiplier.cpp index 883092a3e3..e6f0692fd9 100644 --- a/tools/ruledit/tab_multiplier.cpp +++ b/tools/ruledit/tab_multiplier.cpp @@ -65,7 +65,7 @@ tab_multiplier::tab_multiplier(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Rule Name"))); label->setParent(this); rname = new QLineEdit(this); - rname->setText("None"); + rname->setText(R__("None")); connect(rname, SIGNAL(returnPressed()), this, SLOT(name_given())); mpr_layout->addWidget(label, 0, 0); mpr_layout->addWidget(rname, 0, 2); @@ -75,7 +75,7 @@ tab_multiplier::tab_multiplier(ruledit_gui *ui_in) : QWidget() same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); - name->setText("None"); + name->setText(R__("None")); connect(name, SIGNAL(returnPressed()), this, SLOT(name_given())); mpr_layout->addWidget(label, 1, 0); mpr_layout->addWidget(same_name, 1, 1); @@ -140,8 +140,8 @@ void tab_multiplier::update_multiplier_info(struct multiplier *pmul) name->setEnabled(true); } } else { - name->setText("None"); - rname->setText("None"); + name->setText(R__("None")); + rname->setText(R__("None")); same_name->setChecked(true); name->setEnabled(false); } diff --git a/tools/ruledit/tab_tech.cpp b/tools/ruledit/tab_tech.cpp index bcb08fac1e..a30a651e59 100644 --- a/tools/ruledit/tab_tech.cpp +++ b/tools/ruledit/tab_tech.cpp @@ -64,7 +64,7 @@ tab_tech::tab_tech(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Rule Name"))); label->setParent(this); rname = new QLineEdit(this); - rname->setText("None"); + rname->setText(R__("None")); connect(rname, SIGNAL(returnPressed()), this, SLOT(name_given())); tech_layout->addWidget(label, 0, 0); tech_layout->addWidget(rname, 0, 2); @@ -74,7 +74,7 @@ tab_tech::tab_tech(ruledit_gui *ui_in) : QWidget() same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); - name->setText("None"); + name->setText(R__("None")); connect(name, SIGNAL(returnPressed()), this, SLOT(name_given())); tech_layout->addWidget(label, 1, 0); tech_layout->addWidget(same_name, 1, 1); @@ -228,8 +228,10 @@ void tab_tech::update_tech_info(struct advance *adv) req2_button->setText(tech_name(adv->require[AR_TWO])); root_req_button->setText(tech_name(adv->require[AR_ROOT])); } else { - name->setText("None"); - rname->setText("None"); + name->setText(R__("None")); + rname->setText(R__("None")); + // FIXME: Could these be translated, or do we depend on + // them matching English rule_name of tech "None"? req1_button->setText("None"); req2_button->setText("None"); root_req_button->setText("None"); diff --git a/tools/ruledit/tab_terrains.cpp b/tools/ruledit/tab_terrains.cpp index e0173f22af..e3a6ce3680 100644 --- a/tools/ruledit/tab_terrains.cpp +++ b/tools/ruledit/tab_terrains.cpp @@ -65,7 +65,7 @@ tab_terrains::tab_terrains(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Rule Name"))); label->setParent(this); rname = new QLineEdit(this); - rname->setText("None"); + rname->setText(R__("None")); connect(rname, SIGNAL(returnPressed()), this, SLOT(name_given())); terrains_layout->addWidget(label, 0, 0); terrains_layout->addWidget(rname, 0, 2); @@ -75,7 +75,7 @@ tab_terrains::tab_terrains(ruledit_gui *ui_in) : QWidget() same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); - name->setText("None"); + name->setText(R__("None")); connect(name, SIGNAL(returnPressed()), this, SLOT(name_given())); terrains_layout->addWidget(label, 1, 0); terrains_layout->addWidget(same_name, 1, 1); @@ -140,8 +140,8 @@ void tab_terrains::update_terrain_info(struct terrain *pterr) name->setEnabled(true); } } else { - name->setText("None"); - rname->setText("None"); + name->setText(R__("None")); + rname->setText(R__("None")); same_name->setChecked(true); name->setEnabled(false); } diff --git a/tools/ruledit/tab_unit.cpp b/tools/ruledit/tab_unit.cpp index d17febca55..6438028f00 100644 --- a/tools/ruledit/tab_unit.cpp +++ b/tools/ruledit/tab_unit.cpp @@ -66,7 +66,7 @@ tab_unit::tab_unit(ruledit_gui *ui_in) : QWidget() label = new QLabel(QString::fromUtf8(R__("Rule Name"))); label->setParent(this); rname = new QLineEdit(this); - rname->setText("None"); + rname->setText(R__("None")); connect(rname, SIGNAL(returnPressed()), this, SLOT(name_given())); unit_layout->addWidget(label, 0, 0); unit_layout->addWidget(rname, 0, 2); @@ -76,7 +76,7 @@ tab_unit::tab_unit(ruledit_gui *ui_in) : QWidget() same_name = new QCheckBox(); connect(same_name, SIGNAL(toggled(bool)), this, SLOT(same_name_toggle(bool))); name = new QLineEdit(this); - name->setText("None"); + name->setText(R__("None")); connect(name, SIGNAL(returnPressed()), this, SLOT(name_given())); unit_layout->addWidget(label, 1, 0); unit_layout->addWidget(same_name, 1, 1); @@ -144,8 +144,8 @@ void tab_unit::update_utype_info(struct unit_type *ptype) name->setEnabled(true); } } else { - name->setText("None"); - rname->setText("None"); + name->setText(R__("None")); + rname->setText(R__("None")); same_name->setChecked(true); name->setEnabled(false); } -- 2.34.1