From 5b01d2d4d9c1ed901c5a21b2994e2d25458be863 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 4 Mar 2022 23:25:40 +0200 Subject: [PATCH 20/20] 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_tech.cpp | 10 ++++++---- tools/ruledit/tab_terrains.cpp | 8 ++++---- tools/ruledit/tab_unit.cpp | 8 ++++---- 8 files changed, 31 insertions(+), 29 deletions(-) diff --git a/tools/ruledit/tab_building.cpp b/tools/ruledit/tab_building.cpp index 36d51de94c..4c7cd6f3e8 100644 --- a/tools/ruledit/tab_building.cpp +++ b/tools/ruledit/tab_building.cpp @@ -66,7 +66,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); @@ -76,7 +76,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); @@ -144,8 +144,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 8ddcc96da4..bbab7ffa4f 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 16855cad22..c680b47204 100644 --- a/tools/ruledit/tab_extras.cpp +++ b/tools/ruledit/tab_extras.cpp @@ -64,7 +64,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); @@ -74,7 +74,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); @@ -139,8 +139,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 9b7f4d7bcb..845c22dd32 100644 --- a/tools/ruledit/tab_good.cpp +++ b/tools/ruledit/tab_good.cpp @@ -65,7 +65,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); @@ -75,7 +75,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); @@ -140,8 +140,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 cf6166fb98..03bfdef959 100644 --- a/tools/ruledit/tab_gov.cpp +++ b/tools/ruledit/tab_gov.cpp @@ -64,7 +64,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); @@ -74,7 +74,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); @@ -139,8 +139,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_tech.cpp b/tools/ruledit/tab_tech.cpp index 69089345b3..9758fab6b1 100644 --- a/tools/ruledit/tab_tech.cpp +++ b/tools/ruledit/tab_tech.cpp @@ -63,7 +63,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); @@ -73,7 +73,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); @@ -223,8 +223,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 2357a5757f..237ea26c41 100644 --- a/tools/ruledit/tab_terrains.cpp +++ b/tools/ruledit/tab_terrains.cpp @@ -64,7 +64,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); @@ -74,7 +74,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); @@ -135,8 +135,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 48dcc38a7f..21c4c91d2c 100644 --- a/tools/ruledit/tab_unit.cpp +++ b/tools/ruledit/tab_unit.cpp @@ -65,7 +65,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); @@ -75,7 +75,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); @@ -139,8 +139,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