Skip to content

Commit 4163fb9

Browse files
committed
Merge pull request godotengine#89489 from YeldhamDev/yet_another_etr_fix
Fix some translations not properly falling back
2 parents 3e773b9 + 05f6c56 commit 4163fb9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

core/object/object.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ String Object::tr(const StringName &p_message, const StringName &p_context) cons
15371537

15381538
if (Engine::get_singleton()->is_editor_hint()) {
15391539
String tr_msg = TranslationServer::get_singleton()->extractable_translate(p_message, p_context);
1540-
if (!tr_msg.is_empty()) {
1540+
if (!tr_msg.is_empty() && tr_msg != p_message) {
15411541
return tr_msg;
15421542
}
15431543

@@ -1558,7 +1558,7 @@ String Object::tr_n(const StringName &p_message, const StringName &p_message_plu
15581558

15591559
if (Engine::get_singleton()->is_editor_hint()) {
15601560
String tr_msg = TranslationServer::get_singleton()->extractable_translate_plural(p_message, p_message_plural, p_n, p_context);
1561-
if (!tr_msg.is_empty()) {
1561+
if (!tr_msg.is_empty() && tr_msg != p_message && tr_msg != p_message_plural) {
15621562
return tr_msg;
15631563
}
15641564

scene/gui/dialogs.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ Button *AcceptDialog::add_button(const String &p_text, bool p_right, const Strin
317317
Button *AcceptDialog::add_cancel_button(const String &p_cancel) {
318318
String c = p_cancel;
319319
if (p_cancel.is_empty()) {
320-
c = "Cancel";
320+
c = ETR("Cancel");
321321
}
322322

323323
Button *b = swap_cancel_ok ? add_button(c, true) : add_button(c);
@@ -419,13 +419,13 @@ AcceptDialog::AcceptDialog() {
419419

420420
buttons_hbox->add_spacer();
421421
ok_button = memnew(Button);
422-
ok_button->set_text("OK");
422+
ok_button->set_text(ETR("OK"));
423423
buttons_hbox->add_child(ok_button);
424424
buttons_hbox->add_spacer();
425425

426426
ok_button->connect("pressed", callable_mp(this, &AcceptDialog::_ok_pressed));
427427

428-
set_title(TTRC("Alert!"));
428+
set_title(ETR("Alert!"));
429429
}
430430

431431
AcceptDialog::~AcceptDialog() {
@@ -454,7 +454,7 @@ Button *ConfirmationDialog::get_cancel_button() {
454454
}
455455

456456
ConfirmationDialog::ConfirmationDialog() {
457-
set_title(TTRC("Please Confirm..."));
457+
set_title(ETR("Please Confirm..."));
458458
set_min_size(Size2(200, 70));
459459

460460
cancel = add_cancel_button();

0 commit comments

Comments
 (0)