aboutsummaryrefslogtreecommitdiff
path: root/core/ustring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r--core/ustring.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 1f0eadc03..c2520a7a8 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -3963,11 +3963,31 @@ String String::sprintf(const Array& values, bool* error) const {
#include "translation.h"
+#ifdef TOOLS_ENABLED
String TTR(const String& p_text) {
if (TranslationServer::get_singleton()) {
- return TranslationServer::get_singleton()->translate(p_text);
+ return TranslationServer::get_singleton()->tool_translate(p_text);
}
return p_text;
}
+
+#endif
+
+String RTR(const String& p_text) {
+
+
+
+ if (TranslationServer::get_singleton()) {
+ String rtr = TranslationServer::get_singleton()->tool_translate(p_text);
+ if (rtr==String() || rtr==p_text) {
+ return TranslationServer::get_singleton()->translate(p_text);
+ } else {
+ return rtr;
+ }
+ }
+
+ return p_text;
+}
+