summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Alexsander <michaelalexsander@protonmail.com>2024-03-14 16:09:39 -0300
committerMichael Alexsander <michaelalexsander@protonmail.com>2024-03-14 16:38:12 -0300
commit05f6c56a482df23f68788c01ffeadfd7b341dda1 (patch)
tree7cef77563889874d2b12e4aa03d3907b473ef085
parentda945ce6266ce27ba63b6b08dc0eb2414594f7cb (diff)
downloadredot-engine-05f6c56a482df23f68788c01ffeadfd7b341dda1.tar.gz
Fix some translations not properly falling back
-rw-r--r--core/object/object.cpp4
-rw-r--r--scene/gui/dialogs.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp
index e5d771844b..8ec2b802bb 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -1537,7 +1537,7 @@ String Object::tr(const StringName &p_message, const StringName &p_context) cons
if (Engine::get_singleton()->is_editor_hint()) {
String tr_msg = TranslationServer::get_singleton()->extractable_translate(p_message, p_context);
- if (!tr_msg.is_empty()) {
+ if (!tr_msg.is_empty() && tr_msg != p_message) {
return tr_msg;
}
@@ -1558,7 +1558,7 @@ String Object::tr_n(const StringName &p_message, const StringName &p_message_plu
if (Engine::get_singleton()->is_editor_hint()) {
String tr_msg = TranslationServer::get_singleton()->extractable_translate_plural(p_message, p_message_plural, p_n, p_context);
- if (!tr_msg.is_empty()) {
+ if (!tr_msg.is_empty() && tr_msg != p_message && tr_msg != p_message_plural) {
return tr_msg;
}
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index aa67f0d200..3746b667f6 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -317,7 +317,7 @@ Button *AcceptDialog::add_button(const String &p_text, bool p_right, const Strin
Button *AcceptDialog::add_cancel_button(const String &p_cancel) {
String c = p_cancel;
if (p_cancel.is_empty()) {
- c = "Cancel";
+ c = ETR("Cancel");
}
Button *b = swap_cancel_ok ? add_button(c, true) : add_button(c);
@@ -419,13 +419,13 @@ AcceptDialog::AcceptDialog() {
buttons_hbox->add_spacer();
ok_button = memnew(Button);
- ok_button->set_text("OK");
+ ok_button->set_text(ETR("OK"));
buttons_hbox->add_child(ok_button);
buttons_hbox->add_spacer();
ok_button->connect("pressed", callable_mp(this, &AcceptDialog::_ok_pressed));
- set_title(TTRC("Alert!"));
+ set_title(ETR("Alert!"));
}
AcceptDialog::~AcceptDialog() {
@@ -454,7 +454,7 @@ Button *ConfirmationDialog::get_cancel_button() {
}
ConfirmationDialog::ConfirmationDialog() {
- set_title(TTRC("Please Confirm..."));
+ set_title(ETR("Please Confirm..."));
set_min_size(Size2(200, 70));
cancel = add_cancel_button();