diff options
| author | Juan Linietsky | 2016-05-17 18:27:15 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-05-17 18:28:44 -0300 |
| commit | c195c0df6b36debc870216dd42e49fbda70fa861 (patch) | |
| tree | 194a26e39ace86d7a471f3e86159c2aed6be261c /core/ustring.cpp | |
| parent | 3a26e14a2bab777c9ba6aedceff6e4ef2666faf0 (diff) | |
| download | godot-c195c0df6b36debc870216dd42e49fbda70fa861.tar.gz godot-c195c0df6b36debc870216dd42e49fbda70fa861.tar.zst godot-c195c0df6b36debc870216dd42e49fbda70fa861.zip | |
Diffstat (limited to 'core/ustring.cpp')
| -rw-r--r-- | core/ustring.cpp | 22 |
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; +} + |
