diff options
| author | Juan Linietsky | 2016-05-03 22:25:37 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-05-03 22:25:37 -0300 |
| commit | 567cb691ec49844101247bb9dc34bc2722f6af4f (patch) | |
| tree | caa577fdc22feec8869e66b32be34db0c90f8aa8 /core/translation.cpp | |
| parent | c7e8def44696da9ddf0b459e166280668c84c4cb (diff) | |
| download | godot-567cb691ec49844101247bb9dc34bc2722f6af4f.tar.gz godot-567cb691ec49844101247bb9dc34bc2722f6af4f.tar.zst godot-567cb691ec49844101247bb9dc34bc2722f6af4f.zip | |
Diffstat (limited to 'core/translation.cpp')
| -rw-r--r-- | core/translation.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/translation.cpp b/core/translation.cpp index e4dad8d8d..85e207e08 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); |
