summaryrefslogtreecommitdiff
path: root/core/translation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/translation.cpp')
-rw-r--r--core/translation.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/translation.cpp b/core/translation.cpp
index e4dad8d8de..85e207e08d 100644
--- a/core/translation.cpp
+++ b/core/translation.cpp
@@ -665,6 +665,22 @@ void TranslationServer::setup() {
}
+void TranslationServer::set_tool_translation(const Ref<Translation>& p_translation) {
+ tool_translation=p_translation;
+}
+
+StringName TranslationServer::tool_translate(const StringName& p_message) const {
+
+ if (tool_translation.is_valid()) {
+ StringName r = tool_translation->tr(p_message);
+ if (r)
+ return r;
+ }
+
+ return p_message;
+}
+
+
void TranslationServer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_locale","locale"),&TranslationServer::set_locale);