diff options
Diffstat (limited to 'core/translation.cpp')
-rw-r--r-- | core/translation.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/translation.cpp b/core/translation.cpp index e4dad8d8de..ee0ef2ea09 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -665,6 +665,24 @@ 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->get_message(p_message); + + if (r) { + return r; + } + } + + return p_message; +} + + void TranslationServer::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_locale","locale"),&TranslationServer::set_locale); |